Update from solution in oracle

xiaoxiao2021-03-06  117

There is no Update from function similar to SQL Server in Oracle to a solution to / * formatted on 2004/10/26 11:15 (Formatter Plus v4.5.2) * / update Tablea a set a.fieldforupdate = (Select B.fieldsource from Tableb b where a.keyfield = B.Keyfield) Where exists (SELECT B.FIELDSOURD) WHERE EXISTS (SELECT B.FIELDSOURD = B. Keyfield) Example Table Text Fielda Fieldb Fieldc 1 2004-1-1 2004-2-1 2 2004 2-2 2004-3-1 3 2004-3-1 2004-4-1 If you want to update the C field value of record 1 according to the record 2, you can use the following SQL / * Formatted On 2004/10/26 11 : 25 (Formatter Plus v4.5.2) * / update text a set a.fieldb = (Select B.fieldb from get b where A.fielda = B.fielda and b.fieldb> a.fieldb and b.fieldb - a. Fieldb <= 35) Where exists (SELECT B.FIELDB FROM TEXT B Where A.fielda = B.fielda And B.fieldb> a.fieldb and b.fieldb - a.fieldb <= 35)

转载请注明原文地址:https://www.9cbs.com/read-100906.html

New Post(0)