–形成表空列语句,形成sql语句以后再执行,可以获取列为null字段
select ‘select field
from (select field,null_count
from (select ’ ||wm_concat(’(
select count (1) from YOUR_TABLE b where b.’|| column_name || ’ is not null )’ || column_name) ||’
from dual) t unpivot (null_count for field in (’ ||wm_concat(column_name) || ‘)) ) t where t.null_count=0;’
from user_tab_columns
where table_name = ‘YOUR_TABLE’;
--形成表空列语句,形成sql语句以后再执行,可以获取列为null字段
最新推荐文章于 2024-09-02 10:15:34 发布