oracle-两个 count(1) 相减 的两种方法

--方法一
select(select count(1) from 表1)
-(select count(1) from 表2)
from dual

--方法二
select  a.a-b.b from
(select count(1) a from 表1) a,
(select count(1) b from 表2) b


猜你喜欢

转载自blog.csdn.net/chenchen879689889/article/details/78860679