select * from table t1 where not exists(select 1 from t t2 where t2.name="张三" and t2.dept='业务部' and t1.name=t2 and t1.dept=t2.dept)
select * from table t1 where not exists(select 1 from t t2 where t2.name="张三" and t2.dept='业务部' and t1.name=t2 and t1.dept=t2.dept)
select * from table t where t.name <> '张三' and t.dept='业务部';2 not in:
select * from table t where t.name not in ('张三') and t.dept='业务部';3 not exists:
select * from table t where t.dept='业务部'
and not exists (select 1 from table tt where tt.id=t.id and tt.name='张三' );
或者
select * from t_name t where t.name !='xxxx' and t.dept='xxx'
select * from table t where (t.name , t.dept) <>(select "张三",'业务部' from dual )如果还不行的话 用
select * from table t where (t.name , t.dept) not in("张三",'业务部')
或者
select * from table t where (t.name , t.dept) not in (select "张三",'业务部' from dual )