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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -