0

想像してみてください:t1 = 1 t2 = 3 t3 = 5

各テーブルで個別の選択を実行し、カウントを単一の量で報告する必要があります。

 select * 
   from (select count(*) from t1)
          + (select count(*) from t2)
          + (select count(*) from t3);

私の最終結果は=9になるはずです

4

2 に答える 2

3

あなたはかなり近いです。あなたは書ける:

 select (select count(*) from t1)
        + (select count(*) from t2)
        + (select count(*) from t3)
 ;
于 2012-09-20T15:41:13.773 に答える
1
select 
    (select count(*) from t1)
    + (select count(*) from t2)
    + (select count(*) from t3);
于 2012-09-20T15:43:32.700 に答える