sql not in
时间:2014-05-23 10:43:12
收藏:0
阅读:344
sql 语句比较
两个很基础的SQL 可是我一不小心就写错了。特此记录。
SELECT * FROM `jk_usertags` ut WHERE ut.`id` NOT IN (SELECT tagid FROM `jk_tagvsuser` GROUP BY tagid)
SELECT * FROM `jk_usertags` ut ,(SELECT tagid FROM `jk_tagvsuser` GROUP BY tagid) test WHERE ut.`id` NOT IN (test.tagid)
SELECT * FROM `jk_usertags` ut ,(SELECT tagid FROM `jk_tagvsuser` GROUP BY tagid) test WHERE ut.`id` NOT IN (test.tagid)
评论(0)