I have a fairly simple requirement -I have a table with the following (relevant) structure.
with cte as(
select 1 id,'AA,AB,AC,AD' names union all
select 2,'BA,BB' union all
select 3,'CA,CB,CC,CD,CE' union all
select 4,'DA,DB,DC'
)
i would like to create a select statement which will split each "names" column into multiple rows.
For example the first row should produce
1,'AA'
1,'AB'
1,'AC'
1,'AD'
Can we do it using only SQL. This is failry easy to do in Oracle.