查找T1中,不在T2中的元素,虽然SNO不在,但可能是操作员输入错误,日期跟金额是正确的,现在要找的就是确实是操作员没有输入的元素,
我是先做T1T2的等值连接,然后再作集合运算,但是总是出不来数据,
语句是select *from T1
where T1.sno=T2.sno
and T1.sno not in (select T2.sno where T1.sno=T2.sno)and T1.money not in (select T2.money where T1.sno=T2.sno)
and T1.data not in (select T2.data where T1.son=T2.sno)
在sql2000数据库里测试运行没问题,在transfromer里没有发现语法错误
却出不来结果
这是怎么回事!!后台数据库为DB2在线等待
select *from T1
where T1.sno=T2.sno
and T1.sno not in (select T2.sno FROM where T1.sno=T2.sno)and T1.money not in (select T2.money FROM where T1.sno=T2.sno)
and T1.data not in (select T2.data FROM where T1.son=T2.sno) 从语句上看,貌似少了from 关键字。