EXISTS使用

1 --至少两个表有一定的关系条件
2 select * from tanme where
3 EXISTS (select * from tname2 where id=1 
4 and tname2.con=tname.con);
5 --至少两个表有一定的关系条件
6 select * from tanme where
7 not EXISTS (select * from tname2 where id=1 
8 and tname2.con=tname.con);

 

posted @ 2017-05-24 09:12  GLing  阅读(167)  评论(0编辑  收藏  举报