Возможно ли добавить оператор "Case" внутри другого "Case"? Это не работает по-моему.
"case when (cia.nif is not null then cia.nif else case when(d.owner then c2.cif else '')) as cia_externa_nif, " +
Может кто-нибудь помочь мне? Спасибо!
Вот пример
select order_id, max(timestamp), case when max(case when action = 'D' then timestamp end) is not null then 1 else 0 end myAlias from ORDER group by order_id