Here's my query :
SELECT
max(g.name) as good_name,
max(cp.goods_id) as c5good_id
,listagg(CASE WHEN inf.id IS NULL THEN cp.catalogues_properties_description_id ELSE inf.name END ,'-' ON OVERFLOW TRUNCATE) information
,listagg(attr.name,'-' ON OVERFLOW TRUNCATE) attributes
from goods_cp cp
LEFT JOIN catalogues_properties attr ON cp.catalogues_properties_id=attr.id
LEFT JOIN catalogues_properties inf ON cp.catalogues_properties_description_id = TRIM(to_char(inf.id))
join goods g on g.id = cp.goods_id
where cp.goods_id = 123456 ---no data found for this id
the id that I put for my where clause condition is invalid and the query must no records , but when I use listaggor any aggregation function , it will return 1 null record for me . Why is that happening ?