trick 发表于 2013-3-17 19:36:52

exists

select id
from t1
where exists
   (select *
    from t2 ,t1
    where t2.id=t1.id);
为什么会显示t1中的所有id?

发表于 2013-3-18 08:51:13

怎么像 数据库。。http://app.qlogo.cn/mbloghead/b39c404c71170ca2bac6

kider 发表于 2013-3-18 10:05:46

where exists
其中加个你需要判断有误值的字段试试

小新 发表于 2013-3-18 11:46:44

select id
from t1
where exists
   (select 1
    from t2
    where t2.id=t1.id);
这样吧。
页: [1]
查看完整版本: exists