Select * From A Where Money In (Select money from (select money,count(*) cnt from A group by money) a, (select money,count(*) cnt from B group by money) b Where a.money=b.money and a.cnt!=b.cnt )
select identity(int,1,1) id,* into #a from a select identity(int,1,1) id,* into #b from bselect * from ( select (select count(*) from #a where [money]=tem.[money] and id<=tem.id) id,[money] from #a tem) a where not exists (select 1 from ( select (select count(*) from #a where [money]=tem.[money] and id<=tem.id) id,[money] from #a tem) b where a.id=b.id and a.[money]=b.[money])drop table #a,#b
select 1 ???是什么意思呀?
(Select money from
(select money,count(*) cnt from A group by money) a,
(select money,count(*) cnt from B group by money) b
Where a.money=b.money and a.cnt!=b.cnt
)
select identity(int,1,1) id,* into #b from bselect * from (
select (select count(*) from #a where [money]=tem.[money] and id<=tem.id) id,[money] from #a tem) a
where not exists (select 1 from (
select (select count(*) from #a where [money]=tem.[money] and id<=tem.id) id,[money] from #a tem) b
where a.id=b.id and a.[money]=b.[money])drop table #a,#b