1
Given two tables, the product table and the order table, I am trying to update(update) the product description of the products table when the product status is 'INACTIVE' and the order table status is 'CLOSED'
create table PEDIDOS
(
CLIENTE_ID NUMBER not null,
PRODUTO_ID NUMBER not null,
DT_INSTAL DATE not null,
STATUS VARCHAR2(40),
PEDIDO_ID NUMBER not null
)
create table PRODUTOS
(
PRODUTO_ID NUMBER not null,
DESCRICAO VARCHAR2(40) not null,
VALOR VARCHAR2(13) not null,
STATUS VARCHAR2(13) not null,
TIPO VARCHAR2(1)
)
For example, I have a product of id 1 and description 'televisión', if that television is inactive and in the order table (according to id) is closed, I want to change the description to any other name. How do I join two tables in the UPDATE command? What I’m getting, if anyone can help, thank you.
highlighting the @R.Santos' comment, here’s an example of a Rigger with multiple updates http://oracle.ittoolbox.com/groups/technical-functional/oracle-sql-l/update-multiple-tables-in-a-single-statement-1958597
– Daniel Gentil