0
Select Count(1) as COUNT1 from
(
Select A,B from table1
union
Select A, B from table2
)
Select Count(1) as COUNT2 from
(
Select C,D from table3
union
Select C,D from table4
)
Select Count(1) as COUNT3 from
(
Select E,F from table5
union
Select E,F from table6
);
我想顯示一個表,顯示COUNT1,COUNT2,COUNT3。我想將各種SQL查詢的計數合併爲一個以顯示各列
由於您只使用計數,因此只能從查詢返回單個數值。所以你可以外部連接這些來獲得所有三個計數的單行 –
@SchmitzIT這不會給你3行而不是1行。 –