MariaDB右外连接用于从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;
输出:
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)