查询某个字段不在查询结果中的记录

参考新浪文章http://blog.csdn.net/liuxilil/article/details/6718409

--测试不可

select * from [dbo].[Storage_WeiWai] where WeiWaiId  not in (select RowGuid from  [dbo].[Storage_InAndOutMain])

--测试可以
select * from [dbo].[Storage_WeiWai] a where not exists (select 1 from  [dbo].[Storage_InAndOutMain] b where a.WeiWaiId=b.RowGuid )
posted @ 2015-09-16 16:33  Alfred.Xu  阅读(325)  评论(0编辑  收藏  举报