SET HEADING ON
SET FEEDBACK OFF
SET LINESIZE 200
SET PAGESIZE 200
-- 检测数据按 data_source 和 station_id 是否为空分组统计
SELECT data_source, 
       CASE WHEN station_id IS NULL THEN NULL ELSE NOT_NULL END AS station_status,
       COUNT(1) AS cnt
FROM CONTINEW_ZHICHAO.wim_detection 
GROUP BY data_source, CASE WHEN station_id IS NULL THEN NULL ELSE NOT_NULL END
ORDER BY data_source;
EXIT
