赞
踩
目录
left join + union + right join语句
full outer join结合了 LEFT JOIN 和 RIGHT JOIN 的结果,并使用NULL值作为两侧缺失匹配结果。
- SELECT
- table1.column_name(s),table2.column_name(s)
- FROM table1
- FULL OUTER JOIN table2
- ON table1.column_name = table2.column_name;
相当于:left join + union + right join
- SELECT
- table1.column_name(s),table2.column_name(s)
- FROM table1
- LEFT OUTER JOIN table2
- ON table1.column_name = table2.column_name;
- UNION
- SELECT
- table1.column_name(s),table2.column_name(s)
- FROM table1
- RIGHT OUTER JOIN table2
- ON table1.column_name = table2.column_name;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。