What will be the result of such a query:

INSERT INTO `table` (f1,f2,f3,f4) SELECT 4,f2,f3,f4 FROM `table` WHERE f1=3; 

if there are several lines with a f1=3 field value?

More precisely, I need to duplicate all the lines with the value of the field f1=3 , replacing the value of this field with 4.

    1 answer 1

    The request will be executed correctly, just checked. If f1 is multiple, then all of them will be added to this table.

    • Thank you, I did not dare to check, because the table is valuable and did not want to spoil it "if suddenly" ... - Yoharny Babay
    • one
      And you, for verification, would launch your request by commenting out the INSERT clause. And everyone would understand% -) - BuilderC
    • I know the result of the SELECT, but whether the INSERT will be repeated several times with a set of SELECTs — that was not clear. - Yoharny Babay