I am trying to create an insert statement, below is what I have so far:
INSERT INTO Role (application, developer, role)
VALUES (? ,
(SELECT Id from Developer WHERE firstName='Alice' and lastname='Wonderland'),
'ARCHITECT');
In the missing value field, I am trying to do a join, the following join statement returns the VALUES I need:
SELECT a.id
FROM Application a
JOIN application d ON d.id = a.id and a.category='GAMES'
However, when I insert the previous query into the missing value field in the insert statement, it gives me an error stating that the query returned more than 1 row (which is intentional, seeing as I want ALL rows returned to be inserted into the role table)
Can anyone provide me feedback on how to fix this issue?
insert into ... values (1,1), (2,2)or by usinginsert into ... select ...GAMESapplications would be:SELECT id FROM application WHERE category = 'GAMES';