There is a table with columns x, y, z It is necessary to check each line, that if in a line the value of the field y = i then add several lines with the same values of x, z, but with another y, and check if there is no such line
Example:
Исходная таблица: xyz 1 2 3 5 6 7 Итоговая таблица: xyz 1 2 3 5 6 7 1 45 3 1 38 3 5 68 7 5 23 7
insert ignore into table(x,y,z) select x, 45, z from table where y=2if there is a unique key on the table from columns x, y, z. And so for each new value. or complicate select and force it to generate such strings from the list of new values - Mike