Home » SQL & PL/SQL » SQL & PL/SQL » Easy update (but not for me:(
icon9.gif  Easy update (but not for me:( [message #239790] Wed, 23 May 2007 05:37 Go to next message
juhani
Messages: 7
Registered: May 2007
Junior Member
Hi,
I need for this UPDATE-clause. I have forgot the syntax for it.


UPDATE TABLE1
SET TABLE1.col1=' ', TABLE1.col2=' '
where TABLE1.col1=TABLE2.col1
and TABLE1.col2=TABLE3.col2
And TABLE1.Col2=TABLE3.Col1

-juhan
Re: Easy update (but not for me:( [message #239794 is a reply to message #239790] Wed, 23 May 2007 05:46 Go to previous messageGo to next message
martijn
Messages: 283
Registered: December 2006
Location: Netherlands
Senior Member
What happens when you try it?
and... have a look in the docu. : sql-reference
Re: Easy update (but not for me:( [message #239796 is a reply to message #239790] Wed, 23 May 2007 05:54 Go to previous message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
I can't really see it working, since table2 and table3 don't appear in the update or a subquery. You might want something like:

UPDATE TABLE1
SET TABLE1.col1=' ', TABLE1.col2=' '
where exists
(select 1 from table2 where
TABLE1.col1=TABLE2.col1)
and exists
(select 1 from table3
where TABLE1.col2=TABLE3.col2
And TABLE1.Col2=TABLE3.Col1)
Previous Topic: Using Case in Where clause
Next Topic: Transpose of row to column
Goto Forum:
  


Current Time: Mon Dec 05 14:37:01 CST 2016

Total time taken to generate the page: 0.07781 seconds