2016年1月27日 星期三

SQL SELECT WHERE NOT EXISTS

SQL SELECT WHERE NOT EXISTS


找出t_SYS_User資料表中,與t_SYS_Group之間沒有相關連的資料

  1.   SELECT * FROM (
  2.  
  3. SELECT docno,name,ename,goid FROM t_SYS_User
  4.  
  5.   ) u
  6.   WHERE NOT EXISTS (
  7.  
  8.       SELECT oid FROM t_SYS_Group
  9.  
  10.  WHERE oid=u.goid
  11.   )
  12.  

1 則留言:

  1. Thank you for this article. Personally, I think this material is great. I agree with much of your information here. It also motivates me to learn more. I await the next article with great anticipation.The name is given, probably as a result of [genghis khan]'s mongol empire, which saw mongols breed with the natives of most asian races/tribes. The key factors in deciding whether a skull is goid or not lie in the eyes and nose.

    回覆刪除