还有个问题想在这里一块请教。在oracle中,我喜欢用
外连接代替not in查询(还有其他的方法,比如用not exists或者minus)
比如:查询A表中有但是B表中没有的,在oracle中可以用
select A.* from A,B
where A.field1=B.field1(+)
and B.field1 is null
但是在sybase中,我用
select A.* from A,B
where A.field1=*B.field1
and B.field1 is null
或者
select A.* from A,B
where A.field1=*B.field1
and B.field1=null
都是不对!而且也没有minus,呵呵,我只好用
select A.* from A
where not exists (select 'ppp' from B where B.field1=A.field1)