Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UPDATE
- merce_product_attribute_combination modificando
- INNER JOIN (
- (SELECT
- tidicho.id_attribute AS newId,
- tidicho2.id_attribute AS oldId,
- tidicho2.id_product_attribute
- FROM
- (SELECT
- a.`id_attribute`,
- a.`name`
- FROM
- merce_attribute_lang a
- INNER JOIN
- (SELECT
- b.`name`,
- COUNT(*) AS c
- FROM
- merce_attribute_lang b
- WHERE b.`id_lang` = 1
- GROUP BY b.`name`
- HAVING c > 1) dup
- ON a.`name` = dup.name
- WHERE a.`id_lang` = 1
- GROUP BY a.`name`) tidicho
- INNER JOIN
- (SELECT
- a.`id_attribute`,
- a.`id_product_attribute`,
- b.`name`
- FROM
- `safisa_pre`.`merce_product_attribute_combination` a
- INNER JOIN merce_attribute_lang b
- ON a.`id_attribute` = b.`id_attribute`
- WHERE b.`id_lang` = 1) tidicho2
- ON tidicho.name = tidicho2.name) newidd
- )
- ON newidd.oldId = modificando.`id_attribute`
- AND newidd.id_product_attribute = modificando.`id_product_attribute` SET `id_attribute` = newidd.newId
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement