Created
June 15, 2020 03:41
-
-
Save czwen/35a507918e34f02c94d9537dc2a1ca89 to your computer and use it in GitHub Desktop.
update join
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE t_product | |
JOIN r_product_class on t_product.id = r_product_class.product_id | |
JOIN t_class on t_class.id = r_product_class.class_id | |
SET t_product.school_id = t_class.school_company_id; | |
UPDATE t_product_template | |
JOIN r_product_class on t_product_template.product_id = r_product_class.product_id | |
JOIN t_class on t_class.id = r_product_class.class_id | |
SET t_product_template.school_id = t_class.school_company_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
INSERT INTO table2 (column1, column2, column3, ...)
SELECT column1, column2, column3, ...
FROM table1
WHERE condition;