Мне нужна помощь, чтобы преобразовать все строки в столбец.
т.е. столбцы no.of = общее количествозначений в col2 и col3, относящихся к col1.
Сценарий
Попытка запроса:
with cte as (
select 'A' as col1, 1 as col2, 2 as col3 from dual
union
select 'A' as col1, 3 as col2, 4 as col3 from dual
union
select 'A' as col1, 5 as col2, 6 as col3 from dual
union
select 'B' as col1, 10 as col2, 101 as col3 from dual
union
select 'B' as col1, 20 as col2, 202 as col3 from dual
union
select 'C' as col1, 50 as col2, 501 as col3 from dual
union
select 'C' as col1, 60 as col2, 601 as col3 from dual
union
select 'C' as col1, 70 as col2, 701 as col3 from dual
) select * from cte
Как мне написать сводный запрос здесь?