DELETE FROM lots
WHERE id NOT IN
(SELECT MAX(id)
FROM lots
GROUP BY lotNumber, purchaseNumber);
SELECT j.result_color
FROM structure_test t
JOIN JSON_TABLE(t.structure,
'$.exodus[*]'
COLUMNS(result_combination varchar(20) PATH '$.result_combination',
result_color varchar(20) PATH '$.result_color',
result VARCHAR(20) PATH '$.result',
result_description VARCHAR(255) PATH '$.result_description')) j
WHERE j.result = 'IT разработка';
$db->query("SELECT p.product_id, pd1.name as name_ru, pd2.name as name_en, pd1.description as description_ru, pd2.description as description_en
FROM product p
LEFT JOIN product_description pd1 ON p.product_id = pd1.product_id AND pd1.language_id = 1
LEFT JOIN product_description pd2 ON p.product_id = pd2.product_id AND pd2.language_id = 2
GROUP BY p.product_id"
);