Sujeet Raman

Sujeet Raman

  • 864
  • 927
  • 352.9k

Subquery returned more than 1 value This is not permitted ??

Jul 23 2020 6:56 AM
i am copying 2 column from a source table to target.
 
issue is when i selecting 2 column values and and trying to inserting to target table, i am getting below error.any idea?
 
Msg 512, Level 16, State 1, Line 27
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
 
INSERT INTO destinationtable(firstname,lastname,age,school)
SELECT
(SELECT sourcetable.firstname From sourcetable),
(SELECT sourcetable.lastname From sourcetable),19,UP school

Answers (2)