Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update using Same Table

Status
Not open for further replies.

jetec

Technical User
May 2, 2006
17
US
I would like to update TABLE_A using TABLE_A.

Something like this...

UPDATE TABLE_A
(FLD_START)
=
(
SELECT fld_A from tbl_ref where tbl_ref.fieldB = table_a.fieldB from TABLE_A)

but i get a "too rows returned" error..

Any ideas or guidance?

Thanks
JE
 

Sure you don't get a SYNTAX error? [ponder]


----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
This is pseudo code, right? The error is because:
Code:
SELECT fld_A from tbl_ref where tbl_ref.fieldB = table_a.fieldB from TABLE_A
is returning more than one row.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: Emu Products Plus
 
If you are simply trying to set the column FLD_START to the value of FLD_A then

update table_a
set fld_start = fld_a;



Bill
Oracle DBA/Developer
New York State, USA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top