sql语句求助:select a from dbo.A where c=1 intersect selcet b from dbo.B where d=1 如何得知行个数

问题已经解决了,谢谢大家

第1个回答  2012-12-15
你自己在sql查询分析器里面运行一下,不就知道了吗。如果需要别人帮你运行就需要你所使用的表结构。
第2个回答  2012-12-15
select怎么写成selcet了,语句的意思是找出A中C=1的a与B中d=1的b相同

select count(*) from (select a from dbo.A where c=1 intersect select b from dbo.B where d=1) as C

select distinct count(*) from (select a from dbo.A where c=1 intersect select b from dbo.B where d=1) as C

select count(C.a) from (select a from dbo.A where c=1 intersect select b from dbo.B where d=1) as C
group by C.a
=。=吃饭去了本回答被提问者和网友采纳
第3个回答  2012-12-19
select count (0) from(
select a from dbo.A where c=1 intersect selcet b from dbo.B where d=1
)
as t
相似回答