MariaDB RIGHT OUTER JOIN用于返回在ON条件中指定的右侧表中的所有行, 仅返回满足连接字段条件的另一张表中的行。
MariaDB RIGHT OUTER JOIN也称为RIGHT JOIN。
句法:
SELECT columns
FROM table1
RIGHT [OUTER] JOIN table2
ON table1.column = table2.column;
图像表示:
例:
SELECT Students.student_id, Students.student_name, Students.student_address, Employee2.salary, Employee2.emp_address
FROM Students
RIGHT JOIN Employee2
ON Students.student_id = Employee2.emp_id;
输出
评论前必须登录!
注册