Given two tables, product and order tables, I'm trying to update the product description of the products table when the product status is 'INATIVE' and the status of the orders table 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 'television', if this television is inactive and the table requests (according to the id) is closed, I want to change the description to any other name. How do I join two tables in the UPDATE command? I can not do it, if anyone can help, thank you.