SELECT pa1.product_id, pa1.attribute_id, 3, pa1.text
FROM car_product_attribute pa1
LEFT JOIN car_product_attribute pa2 ON
pa1.attribute_id = pa2.attribute_id AND pa1.product_id = pa2.product_id
AND pa1.language_id=2 and pa2.language_id=3
where pa2.product_id is null and pa1.language_id <>3
MySQL вернула пустой результат (т.е. ноль строк)
DELETE FROM `car_product_attribute` WHERE `car_product_attribute`.`product_id` = 68 AND `car_product_attribute`.`attribute_id` = 15 AND `car_product_attribute`.`language_id` = 3;
DELETE FROM `car_product_attribute` WHERE `car_product_attribute`.`product_id` = 68 AND `car_product_attribute`.`attribute_id` = 18 AND `car_product_attribute`.`language_id` = 3;
SELECT pa1.product_id, pa1.attribute_id, 3, pa1.text FROM car_product_attribute pa1 LEFT JOIN car_product_attribute pa2 ON pa1.attribute_id = pa2.attribute_id AND pa1.product_id = pa2.product_id AND pa1.language_id=2 and pa2.language_id=3 where pa2.product_id is null and pa1.language_id <>3
Отображение строк 0 - 1 (2 всего,
INSERT INTO car_product_attribute (product_id,attribute_id, language_id, text) SELECT pa1.product_id, pa1.attribute_id, 3, pa1.text FROM car_product_attribute pa1 LEFT JOIN car_product_attribute pa2 ON pa1.attribute_id = pa2.attribute_id AND pa1.product_id = pa2.product_id AND pa1.language_id=2 and pa2.language_id=3 where pa2.product_id is null and pa1.language_id <>3
Добавлено 2 строки.