如何用SQL语句查出该表中 不为空的值得数量
(studentLoginId不为空的有几个,parentLoginId不为空的有几个,它们的和)
select (select count(1) from table where studentLoginId is null) scount,
(select count(1) from table where parentLoginId is null)) pcount,
(select count(1) from table where studentLoginId is null)+(select count(1) from table where parentLoginId is null)) suncount
from dual;
select count(*) from xxx where xxx is not null
select count(*) from table_name where studentLoginId is not null
select count(*) from table_name where parentLoginId is not null
select count(*) from (
select * from table_name where studentLoginId is not null
union all
select * from table_name where parentLoginId is not null
) total
select count(*) from xxx where xxx is not null
select count(*) from tb where studentLoginID is not null
或者
select count(*) from tb where nvl(studentLoginID,0) <> 0