this query is used for update record into tables with join and where query which update all matching records.
UPDATE `product`
inner join `category` on `category`.`id` = `product`.`category_id` and `category`.`deleted_at` IS NULL
SET `product`.`category_id` = category.id WHERE `product`.`deleted_at` IS NULL AND `id` = '1'
No comments:
Post a Comment