Hi guys, I want to update columns from two tables.
For example: abc
and xyz
. The abc
table contains fields called id
, fname
, lastname
, status
. And the table xyz
contains id
, x_id
and status
. Now what I want is to update a column status from abc
and status
column from xyz
by using single query.
I try this query, but it is not working.
UPDATE abc a1
JOIN xyz x1 ON a1.id = x1.x_id
SET a1.status = "D" ,
x1.status = "delete"
WHERE a1.id = 15 AND x1.x_id = 15;
Thanks.