update multiple fields [message #374470] |
Wed, 13 June 2001 17:36 |
ginger
Messages: 2 Registered: June 2001
|
Junior Member |
|
|
i'm just a beginner in oracle. can anyone help me how to update multiple fields which relates to multiple table...
here is my SQL statement:
select a.id,
b.address,
b.name,
c.date
from TABLE1 a,
TABLE2 b,
TABLE3 c
where a.id = b.id
and b.id = c.id
and c.date > '29-MAY-2001'
and a.tag = 'Y'
and c.update = 'Y'
i want to update TABLE1 with the output on my SQL Statement.
i need answer asap. thanks so much!
|
|
|
Re: update multiple fields [message #374485 is a reply to message #374470] |
Thu, 14 June 2001 08:18 |
Bala
Messages: 205 Registered: November 1999
|
Senior Member |
|
|
Hi,
update table1 set
(address, name, date) =
(select
b.address,
b.name,
c.date
from TABLE1 a,
TABLE2 b,
TABLE3 c
where a.id = b.id
and b.id = c.id
and c.date > '29-MAY-2001'
and a.tag = 'Y'
and c.update = 'Y');
ID is the primary key for table1?
you can not update primary key, thats why i removed it from update and select statements.
|
|
|
|
|