I have table with the following structure:
FirstName|MiddleName|PatientID
I want in other table to store all distinct FirstNames. I have Created table named TBL and I want to insert into it all distinct FirstName rows. Let's assume first table name uis TBL1. I tried the following:
INSERT Into TBL(FirstName) VALUES (SELECT DISTINCT FirstName FROM TBL1)
But I've got error:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, ! =, <, <= , >, >= or when the subquery is used as an expression.
What am I missing here? I am talking about Microsoft Sql Server 2008 R2.