Fixing Error: 1093 mysql you can’t specify target table

I ran into this problem lately and I hope this can help you out..

Problem
INSERT INTO tbl_lang (enname,code,charset,inorder) VALUES (‘asd’,'asd’,'asd’,(SELECT MAX(inorder)+1 from tbl_lang))

Fix:
INSERT INTO tbl_lang (enname,code,charset,inorder) VALUES (‘asd’,'asd’,'asd’,(SELECT MAX(inorder)+1 from tbl_lang as l))

Leave a Reply