I can't get it to stop having syntax errors. The first error I get is:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[name], name_based_id=(SELECT COUNT(*) FROM artists WHERE name='Joe')
Union' at line 3


When I remove the square brackets from NAME, I then get this error:

#1054 - Unknown column 'name_based_id' in 'field list'


Any ideas?