remedy remedy - 1 month ago 4x
MySQL Question

Syntax error with SQL associative entity

I have no idea why this code won't work. Throws syntax error, but from my knowledge this should work. Can someone explain to me what I'm doing wrong.

insert into playerteam(playerId, teamId) select id from player where
player.firstname='John' and select id from team where team.`name`='Swim Team';


Use as given below:

INSERT INTO playerteam(playerId, teamId) 
SELECT (SELECT id FROM player WHERE player.firstname='John'), 
    (SELECT id FROM team WHERE team.`name`='Swim Team');