回 帖 发 新 帖 刷新版面

主题:求一SQL语句!!(急)

如果我用一条SQL语句找出了表TABLE1中N条记录(不管这SQL语句是什么),请问怎么选取没有被这条语句所查询到的记录??

回复列表 (共3个回复)

沙发

select * from table 1
where not exists(select *from table 2
                 where condition and table1.what=table2.what)
不知道有没有用。很久没碰数据库了。嘿嘿

板凳

select * from table1 a
where a.id not in (select top 10 id from table1 b where ....)

3 楼


select top n from table 1 where

我来回复

您尚未登录,请登录后再回复。点此登录或注册