View previous topic :: View next topic
|
Author |
Message |
Mahua Mitra
New User
Joined: 26 Apr 2007 Posts: 49 Location: Delhi
|
|
|
|
I have a table with Clumns a,b,c,d,e and date-timestamp. I need to swap the valus of 'c' and 'd' when Date-timestamp <= '2005-05-13-00.00.00.000000'.
All th 5 columns (a,b,c,d,e) make composite primary ky. I need to do it through sql query
Can ne1 pleas hlp me.
Thanks in advance |
|
Back to top |
|
|
Prajesh_v_p
Active User
Joined: 24 May 2006 Posts: 133 Location: India
|
|
|
|
Can you try out this one?
update table t1 set c = (select d from tabel t2
where t2.a = t1.a
and t2.b = t1.b
and t2.c = t1.c
and t2.d = t1.d ),
d = (select d from tabel t3
where t3.a = t1.a
and t3.b = t1.b
and t3.c = t1.c
and t3.d = t1.d ),
where t1.timestamp <= '2005-05-13-00.00.00.000000'
Thanks,
Prajesh |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
apparently the OP never did. |
|
Back to top |
|
|
|