sql查询

1.SELECT * from aa WHERE aa not in(2,3)
and aa not in(SELECT aa from aa where bb =1 and cc is null);

2.(SELECT * from aa where bb not in (1,2,3)) UNION all (SELECT * from aa where bb =1 and cc is not null )

3.select * from aa  where bb not in(1,2,3) or (bb =1 and cc is not null)

posted on 2015-03-30 12:12  w z y  阅读(118)  评论(0编辑  收藏  举报