Вы можете использовать COALESCE()
в большинстве баз данных:
select COALESCE(SUM(CASE WHEN PROCEDURE_TYPE IN (816) and RAT_TYPE_NAME = '2G' THEN (COUNTER_THROUGHPUT_UL) END), 1) AS COUNTER_THROUGHPUT_UL_2G,
COALESCE(SUM(CASE WHEN PROCEDURE_TYPE IN (816) and RAT_TYPE_NAME = '3G' THEN (COUNTER_THROUGHPUT_UL) END), 1) AS COUNTER_THROUGHPUT_UL_3G,
COALESCE(SUM(CASE WHEN PROCEDURE_TYPE IN (816) and RAT_TYPE_NAME IN ('4G', 'LTE') THEN (COUNTER_THROUGHPUT_UL) END), 1) AS COUNTER_THROUGHPUT_UL_4G
from Table_name;
Я бы также упростил запрос, перенеся общие условия в предложение WHERE
:
select COALESCE(SUM(CASE WHEN RAT_TYPE_NAME = '2G' THEN COUNTER_THROUGHPUT_UL END), 1) AS COUNTER_THROUGHPUT_UL_2G,
COALESCE(SUM(CASE WHEN RAT_TYPE_NAME = '3G' THEN COUNTER_THROUGHPUT_UL END), 1) AS COUNTER_THROUGHPUT_UL_3G,
COALESCE(SUM(CASE WHEN RAT_TYPE_NAME IN ('4G', 'LTE') THEN COUNTER_THROUGHPUT_UL END), 1) AS COUNTER_THROUGHPUT_UL_4G
from Table_name
where PROCEDURE_TYPE IN (816);