TABLE fruit
name family ordered ordered_on
apple tree false null
banana tree false null
mango tree false null
TABLE basket
name family ordered ordered_on
apple tree false null
banana tree false null
I have a Select query comparing two tables using Except. Now I need to change few columns of Table fruit of row mango.
I tried the below query and it updated all the rows in the fruits table:
UPDATE fruits
SET ordered='true', ordered_on = '08/14/2019'
FROM (SELECT LEFT name, family
FROM fruits
EXCEPT
SELECT name, family
FROM basket) AS subquery
I expect the output:
Table fruit:
mango tree true 08/14/2019