开发者

Why is this query failing?

mysql> select ssn from tab2 except select ssn from tab1;

ERROR 1064 (42000): 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 'select ssn from tab1' at


EXCEPT is not supported in MySQL

This article looks at the various ways in which you can do an anti semi join NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL.


To do an "except" you could...

select ssn from tab2 where ssn not in ( select ssn from tab1 )
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜