Update
Hola,
Me gustarÃa saber como puedo realizar un UPDATE tomando como referencia más de una tabla.
Gracias.....
Me gustarÃa saber como puedo realizar un UPDATE tomando como referencia más de una tabla.
Gracias.....
Esto lo saque de la ayuda que trae el cliente 9i.
SET (column_name, column_name, ...) = (subquery4)
This clause assigns the values retrieved from the database by subquery4 to the columns in the column_name list. The subquery must return exactly one row that includes all the columns listed.
The column values returned by the subquery are assigned to the columns in the column list in order. The first value is assigned to the first column in the list, the second value is assigned to the second column in the list, and so on.
In the following correlated query, the column item_id is assigned the value stored in item_num, and the column price is assigned the value stored in item_price:
UPDATE inventory inv -- alias
SET (item_id, price) =
(SELECT item_num, item_price FROM item_table
WHERE item_name = inv.item_name);
SET (column_name, column_name, ...) = (subquery4)
This clause assigns the values retrieved from the database by subquery4 to the columns in the column_name list. The subquery must return exactly one row that includes all the columns listed.
The column values returned by the subquery are assigned to the columns in the column list in order. The first value is assigned to the first column in the list, the second value is assigned to the second column in the list, and so on.
In the following correlated query, the column item_id is assigned the value stored in item_num, and the column price is assigned the value stored in item_price:
UPDATE inventory inv -- alias
SET (item_id, price) =
(SELECT item_num, item_price FROM item_table
WHERE item_name = inv.item_name);
