Сообщение Re[10]: [ora] Агрегация от 28.03.2020 21:18
Изменено 28.03.2020 21:54 IZM
Re[10]: [ora] Агрегация
А если так попробовать:
Select
case when nn=1 then fio else ‘Пусто’ end as Fio2,
case when nn=1 then Inn else ‘Пусто’ end as Inn2
From
(
Select distinct Fio, Inn, 1 as NN From table
Union all
Select distinct Fio, Inn, 2 as NN From table
) q
Order by fio,inn,NN
Select
case when nn=1 then fio else ‘Пусто’ end as Fio2,
case when nn=1 then Inn else ‘Пусто’ end as Inn2
From
(
Select distinct Fio, Inn, 1 as NN From table
Union all
Select distinct Fio, Inn, 2 as NN From table
) q
Order by fio,inn,NN
Re[10]: [ora] Агрегация