| Insert into table from another table based on joining column [message #643852] |
Tue, 20 October 2015 05:32  |
 |
pratik4891
Messages: 73 Registered: February 2011
|
Member |
|
|
Please find my requirement below
Below are the tables -
create table AA
as
select 1 as id ,'A' as item_code from dual
union
select 2 as id ,'B' as item_code from dual
union
select 3 as id ,'C' as item_code from dual
create table BB
as
select 1 as id ,'AAA item' as item_description from dual
union
select 2 as id ,'BBB item' as item_description from dual
union
select 3 as id ,'CCC item' as item_description from dual
I need to union these tables like based on id rows will be inserted in the final table
Needed Output
Id Output
1 A
1 AAA item
2 B
2 BBB item
3 C
3 CCC item
like for id 1 two rows will be together
Can anyone please suggest how to approach this solution ?
Thanks,
|
|
|
|
|
|
|
|
|
|
|
|