我有问题如何根据列表提升数据。例如,我有一个表字段名称为 mhn.kod_urusan。我想根据我输入的列表显示结果。问题是数据不符合我在列表中输入的内容。 “和 mhn.kod_urusan 在('PBPTG','PBMT')”
This is my query:-
select LISTAGG (upper(aa.kod_urusan), ', ') within Group (order by aa.kod_urusan asc) as daerah
from
(select distinct
mhn.kod_urusan,kc.nama nm
from
mohon mhn, kod_urusan ku, kod_caw kc
where
mhn.kod_urusan = ku.kod(+)
and mhn.kod_caw = kc.kod(+)
and (mhn.trh_masuk <= sysdate )
and mhn.kod_urusan in ('PBPTG','PBMT')
and mhn.kod_caw = '01'
order by mhn.kod_urusan asc )aa
This is the result:-
--Daerah--
PBMT, PBPTG
有谁知道是什么问题?