select count(1) from (select distinct unique_id_station from d_wx_expansion_oarea2023 dweo where 1 = 1 and unique_id_station is not null) as a union all select count(1) from (select distinct unique_id_station from d_wx_expansion_oarea2023 where 1 = 1 and is_pdcp_busy_week =1 and unique_id_station is not null) as aaa 将两条sql合成一条
时间: 2024-03-21 07:38:39 浏览: 58
可以使用 UNION ALL 将两条 SQL 合并成一条,如下所示:
```
SELECT COUNT(1) FROM (
SELECT DISTINCT unique_id_station
FROM d_wx_expansion_oarea2023
WHERE unique_id_station IS NOT NULL
) AS a
UNION ALL
SELECT COUNT(1) FROM (
SELECT DISTINCT unique_id_station
FROM d_wx_expansion_oarea2023
WHERE is_pdcp_busy_week = 1 AND unique_id_station IS NOT NULL
) AS aaa
```
阅读全文