例如一个A表,我统计了A表的总行数,然后我想在结果中一同显示A表非空的行数,我在子查询用count()的时候就报不是单分组函数,请问这个问题该怎样去解决呢
select count(1),
(select count(1) from A where A.a is not null)
from A
例如一个A表,我统计了A表的总行数,然后我想在结果中一同显示A表非空的行数,我在子查询用count()的时候就报不是单分组函数,请问这个问题该怎样去解决呢
select count(1),
(select count(1) from A where A.a is not null)
from A
SELECT (SELECT COUNT(*) FROM A),(SELECT COUNT(*) FROM A WHERE A.a is not null)