View set_translation_for_products.sql
INSERT INTO product_lang (id_product,id_lang,title, description) | |
SELECT | |
p.id, | |
l.id_lang, | |
NULL, | |
concat('description_test','_', l.iso_code) | |
FROM products p | |
LEFT JOIN lang l ON l.id_lang != 1 |
View Очистка не нужных свойств
DELETE FROM `feature_value` WHERE id_feature_value NOT IN (SELECT DISTINCT fp.id_feature_value FROM feature_product fp ) AND id_feature NOT IN (112, 111) |
View delete_duplicates.sql
CREATE TEMPORARY TABLE `t_temp` | |
as ( | |
SELECT min(id) as id | |
FROM `table` | |
GROUP BY name, surname | |
); | |
DELETE from `table` | |
WHERE `table`.id not in ( | |
SELECT id FROM t_temp |