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 -> SQL: Updates a table based on a join

SQL: Updates a table based on a join

From: <gamebuddah_at_my-deja.com>
Date: Mon, 27 Mar 2000 15:57:19 GMT
Message-ID: <8bo0cm$779$1@nnrp1.deja.com>


I have a situation where I need to update a table (STATUS) based on another table (VALUES). STATUS has the following columns; name, file1, file2, file3, date. VALUES has the following columns: name, ftp_file, date; name joins to name, date joins to date. What I need to do is to set the values of status.file1 = values.ftp_file where status.name = values.name and status.date = values.date and instr(ftp_file,'A.ZIP') > 0.
The following select statement gives me the clientnames where this match occurs
SELECT s.name
FROM status s, values v
WHERE s.name = v.name and
s.date = v.date and
instr(ftp_file,'A.ZIP') > 0;
But I can't figure out how to turn this into an UPDATE statement. Please let me know if anyone has any insight. gameBuddah

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Mar 27 2000 - 09:57:19 CST

Original text of this message

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