PIVOT:
select * from
(
(
select 'a' value from dual union all
select 'e' value from dual union all
select 'i' value from dual union all
select 'o' value from dual union all
select 'u' value from dual
)
pivot -- use pivot xml to get the o/p in xml
(
count( value)
for value in ('a','e','i','o','u')
)
)
UNPIVOT:
select value from
(
(
select
'a' v1,
'e' v2,
'i' v3,
'o' v4,
'u' v5
from dual
)
unpivot [INCLUDE NULLS]
(
value
for value_type in
(v1, v2,v3,v4,v5) – Also can give ANY here.
)
)
select * from
(
(
select 'a' value from dual union all
select 'e' value from dual union all
select 'i' value from dual union all
select 'o' value from dual union all
select 'u' value from dual
)
pivot -- use pivot xml to get the o/p in xml
(
count( value)
for value in ('a','e','i','o','u')
)
)
UNPIVOT:
select value from
(
(
select
'a' v1,
'e' v2,
'i' v3,
'o' v4,
'u' v5
from dual
)
unpivot [INCLUDE NULLS]
(
value
for value_type in
(v1, v2,v3,v4,v5) – Also can give ANY here.
)
)