mysql - Duplicate column name in "insert...where not exists" statement -
the following part of larger database patch concerning table in roleplay characters linked skills. want on, not skills have in there, skills don't have (with count 0) , must not have (count -1).
insert char2skill select * (select null, 23, 23, -1, '') foo not exists (select * char2skill `char`=23 , skill=23);
the script crashes on line (character #23 linked skill #23 here), saying
1060 - duplicate column name '23'
i guess it's nested select statement use define values should inserted, don't know how fix it...?
mysql version 5.0.51a
thanks in advance!
try add fnurrps "`" around skill
insert char2skill select * (select null, 23, 23, -1, '') foo not exists (select * char2skill `char`=23 , `skill`=23);
Comments
Post a Comment