我有三个select语句如下,我想总结一下记录的总数。我该怎么做?
SELECT COUNT(*) AS Number FROM tableA where user_id = 5 //Total 5 records
SELECT COUNT(*) AS Number FROM tableB where user_id = 5 //Total 6 records
SELECT COUNT(*) AS Number FROM tableC where user_id = 5 //Total 1 records
所以返回结果是12。
3条答案
按热度按时间ecfdbz9o1#
你可以申请
count(*)
结果是union all
:6vl6ewon2#
lawou6xi3#
我认为这应该起作用: