您的位置:首页 > 数据库 > MySQL

MySQL不支持 full outer join,如何做全连接

2015-07-13 11:37 627 查看
[SQL]select user.name, filesource.filename from user full outer join filesource on user.id = filesource.id order by user.name;
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'outer join filesource on user.id = filesource.id order by user.name' at line 1
MySQL看来是不支持full outer join的了,可以这么处理:

select user.name,filesource.filename from user left join filesource on user.id = filesource.id union select user.name,filesource.filename from user right join filesource on user.id=filesource.id;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: