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来做到这一点?
不错,非常实用! –