比如:有三个表,A,B,C,怎样用SQL语句授出A表的id列的总数和B表id列的总数和C表id列的总数,只能用一条SQL语句?怎写?谢了~!

解决方案 »

  1.   

    select count(id) as A表ID个个数式,(select count(id) from B表) as B表ID个个数式,(select count(id) from c表 ) as C表ID个个数式 from A表
      

  2.   

    select 
    [A表的id列的总数]=(select count(*) from A),
    [B表的id列的总数]=(select count(*) from B),
    [C表的id列的总数]=(select count(*) from C)
      

  3.   

    select 
        (select count(*) from A) as [A表的id列的总数],
        (select count(*) from B) as [B表的id列的总数],
        (select count(*) from C) as [C表的id列的总数]