I have a table that I want to insert a new record, with some hard values, but use an existing value for one of the fields if it exists.
INSERT INTO adm_testing
(EmailID, StartDate, Program, ForcedProgram, [Password])
VALUES ('myemail@gmail.com','1207
234031',''
,'',( SELECT TOP 1 EmailID
FROM adm_testing
WHERE EmailID = 'myemail@gmail.com' ))
I get "Subqueries are not allowed in this context. Only scalar expressions are allowed."
Thanks in advance!
Start Free Trial