2011-05-05 3 views

답변

10
select * from 
(select count(*) from tableA), 
(select count(*) from tableB), 
(select count(*) from tableC), 
(select count(*) from tableD); 
+0

감사합니다. 이것은 효과가 있었다. – ziggy

0

같은 수 있습니다.

SELECT * 
FROM (select count(*) as tableA from tableA) a 
     full outer join (select count(*) as tableB from tableB) b 
     full outer join (select count(*) as tableC from tableC) c 
     full outer join (select count(*) as tableD from tableD) d 
+1

감사합니다. 이 작업은하지 못했습니다. 그것은 문자 'd'에 누락 된 키워드에 대해 불평했습니다 – ziggy

2

select count(*) from tableA; 
union all 
select count(*) from tableB; 
union all 
select count(*) from tableC; 
union all 
select count(*) from tableD; 
+0

고마워요. 작동하지만 결과는 수직으로 표시됩니다. – ziggy

+0

감사합니다. 많은 도움이됩니다. –

0

이 시도 하나 같이 (SELECT COUNT (1) counterA 1로 TABLEA에서 더미로), 이 같은 (선택

count (1)을 counterB, 1을 tableB에서 더미로), 3 개 (counterC로 선택 카운트 (1), tableC에서 더미로 1), 4를 (counterD로 선택 카운트 (1), dumm으로 테이블 D2로부터 y)

one.counterA, two.counterB, three.counterC, four.counterD를 하나, 둘, 셋, 넷 중에서 선택하십시오. 여기서 one.dummy = two.dummy 및 two.dummy = three.dummy 및 three. dummy = four.dummy;

관련 문제