select count(table1.*)as _count distinct from table1 where table1.f1 = table2.f2
select Count(*) as count1 from table1if (_count = count1) then ...
select Count(*) as count1 from table1if (_count = count1) then ...
if @c1 = @c2
...
Select f1,f2 from table2
except
select f1 f2 from table1
http://go.163.com/~zcn/db2y040.htm#Header_45我想这方面,SQL Server 和 DB2应该是相同的吧,呵呵
oracle里用minus不就搞定了.
select * from a minus select * from b
或者用多字段IN操作也可以搞定.
select count(*) from table1 where (f1,f2) in (select * from table2)