Needed a sql query for below scenario [message #307235] |
Tue, 18 March 2008 04:00  |
donind
Messages: 95 Registered: February 2007
|
Member |
|
|
Hi,
Here below is the scenario which i required to write a sql for the same.
tab1
Col1 col2 col3 col4
1 2 3 4
5 6 7 8
select col1,col2 from tab1
union all
select col1,col3 from tab1
union all
select col1,col4 from tab1
tab 2
o/p
col1 col2
1 2
1 3
1 4
5 6
5 7
5 8
Tab1 got updated
Col1 col2 col3 col4
1 9 10 11
5 12 13 14
Before Update
Tab2 should get updated with new values of tab1
tab 2 (Needed a updated sql query inorder to update Tab 2 whenever tab1 got updated with new values)..
o/p
col1 col2
1 9
1 10
1 11
5 12
5 13
5 14
Regards
|
|
|
|
|