Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sql to update where all related records meet criteria

Re: sql to update where all related records meet criteria

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 28 Oct 2005 07:27:43 -0700
Message-ID: <1130509663.359953.284600@g43g2000cwa.googlegroups.com>


Two problems: First, your requirements are poorly worded. Exactly which column do you want to update with data from where when the stage_fk = 61?

Second, this looks like homework and you would be better off doing it yourself.

The SQL manual has a section on the UPDATE statement with some examples. This seems to be a very basic update

update version set ?1 = ?2 where stage_fk = 61

In this case ?1 is the target column and ?2 is the source of the data and is likely a SELECT statement which would most likely mean you would need some additional where clause conditions limiting the rows affected by the update to matching the souce of the data (hint - see coordinated sub-query)

HTH -- Mark D Powell -- Received on Fri Oct 28 2005 - 09:27:43 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US