MariaDB社区

标题: exists [打印本页]

作者: trick    时间: 2013-3-17 19:36
标题: exists
select id
from t1
where exists
   (select *
    from t2 ,t1
    where t2.id=t1.id);
为什么会显示t1中的所有id?
作者: 匿名    时间: 2013-3-18 08:51
怎么像 数据库。。[tthread=shileican, Glimmer施磊灿]http://app.qlogo.cn/mbloghead/b39c404c71170ca2bac6[/tthread]
作者: kider    时间: 2013-3-18 10:05
where exists

其中加个你需要判断有误值的字段试试
作者: 小新    时间: 2013-3-18 11:46
select id
from t1
where exists
   (select 1
    from t2
    where t2.id=t1.id);
这样吧。




欢迎光临 MariaDB社区 (http://123.56.88.72/) Powered by Discuz! X3.2