对多个sql 进行count计算后,需要对count出的值再做求和
对多个sql count的值再求和:
SELECT SUM(countnum) FROM (
select count(1) countnum from user c where c.NAME = '张三'
UNION ALL
select count(1) countnum from contact m where m.MOBILE = '10211325601'
UNION ALL
select count(1) countnum from cert n where n.CERT_NO = '123'
)