i am used to escape string when inserting a single tuple into a table but I didn’t find anything about escaping strings on cases of insertion such as this one:
INSERT INTO TABLE1 SELECT * FROM TABLE2 WHERE ...
…I know that TABLE1 and TABLE2 must have identical columns (and they have). But i’m not sure about escaping. Can anyone tell me how MySQL operates in this case of insertion and how should I escape strings, if necessary?
Thanks in advance.
In the case shown there is no need to escape anything as you are working entirely within the database. Obviously the data would have had to have been escaped when populated into table2.