Home » SQL & PL/SQL » SQL & PL/SQL » Needed a sql query for below scenario
Needed a sql query for below scenario [message #307235] Tue, 18 March 2008 04:00 Go to next message
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
Re: Needed a sql query for below scenario [message #307243 is a reply to message #307235] Tue, 18 March 2008 04:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This is NOT an expert question. Why did you post this in expert forum and not in newbie one?

It is clearly stated in the forum description: "Newbies should not post to this forum!"
Expert notion is defined in the sticky: Not an EXPERT? Post in the NEWBIES forum, NOT here
Rules are described in: OraFAQ Forum Guide.

Regards
Michel
Re: Needed a sql query for below scenario [message #307318 is a reply to message #307235] Tue, 18 March 2008 08:03 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Did you forget how to format your posts after all this time?
Previous Topic: how many Sundays
Next Topic: function or proedure / datamodel needs to create
Goto Forum:
  


Current Time: Thu Feb 13 17:18:29 CST 2025