Skip to content
Advertisement

SQL insert multiple values and parent id by selecting from same table

How do I insert multiple values and parent id by selecting from same table

I tried below and getting an error

MySQL said: Documentation #1093 – Table ‘ctg_tbl’ is specified twice, both as a target for ‘INSERT’ and as a separate source for data

Advertisement

Answer

Your query can be made to work by simply converting it to an INSERT INTO ... SELECT:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement