3
我想要做一個SQL查詢來獲得總數,但我不知道如何構造這個查詢。從多個表中總結多個值
select count(*) from table1 where commom_fk in (1234);
select count(*) from table2 where commom_fk in (1234);
select count(*) from table3 where commom_fk in (1234);
select count(*) from table4 where commom_fk in (1234);
select count(*) from table5 where commom_fk in (1234);
我想總結這些結果只是一個查詢,是一種方法來做到這一點?
謝謝大家。 ----- *
已回答。 但是,如果我想用多個common_fk來做到這一點?
不錯,非常實用! –