Re: syntax help - updating multiple rows

From: Frank van Bortel <>
Date: Tue, 29 Jan 2008 19:44:45 +0100
Message-ID: <63be3$479f741d$524b5c40$>

SpaceMarine wrote:
> hello,
> i am a non-SQL expert that occasionally has to do some queries. our
> environment is Oracle 9. i will gladly provide more info if needed.
> i am trying to:
> 1) get all the rows in a table that match a simple criteria, and

select <comma separated list of columns> from table_name
<column_name matches criteria>
[and column_name matches...]

More on the oracle docuemntation site,; look for the SQL Reference:

> 2) copy the column values from those rows into other rows in the same
> table.

> a bit more... we have an InpectionReports table. in it, we have a row
> for every Product for a given PO (purchase order) and InspectionTypeID
> (there are multiple types of inspections). i need a bit of SQL that
> will all let me find all the rows for a given PO/InspectionTypeID
> combo, and then copy my desired column values to all the rows for
> *another* given PO/InspectionTypeID combo.
> as i mentioned all of these rows are stored in the same table, since
> they are unique on ProductID/PO/InspectionTypeID.

select <comma separated list of columns> from inspection_reports
inspectiontypeid = 'WHATEVER' -- this is case sensitive! and PO = some_number;

That will list things (assuming inspectiontypeid is a character field, and po is numeric.).

Not sure what you mean by "my desired column values"; do you supply these, or are these from the table?


Frank van Bortel

Top-posting in UseNet newsgroups is one way to shut me up
Received on Tue Jan 29 2008 - 12:44:45 CST

Original text of this message