Hey everyone, I just wondered if this is possible. My code will say it all
Code:
INSERT INTO DVD(DVD_ID,Title,Description,Rating_ID)
SELECT '111','Rambo','Stallone',
Rating_ID FROM Rating WHERE Rating ='R'
The code above works but I need to get data from two other tables and the following code does not work:
Code:
INSERT INTO DVD(DVD_ID,Title,Description,Rating_ID,Format_ID,Category_ID)
SELECT '111','Rambo','Stallone',
Rating_ID FROM Rating WHERE Rating ='R',
Format_ID FROM Format WHERE Format ='DVD',
Category_ID FROM Category WHERE Category ='Action_Adventure'
I get an error of: "Number of query values and destination fields are not the same."
Any alternative for this or do I have to create two INSERT statements? Any help will be appreciated. Thank you