I am very new to SQL query so, sorry If I miss basic details. Here is the scenario:
I have to search the user email Id inside the column.
the column contains values like
[email protected];[email protected];[email protected];
Now I got the user email id from query:
DECLARE @emailid AS VARCHAR(50)
SELECT @emailid = emailId FROM dbo.tblUser WHERE userName = 'abc' AND projectId ='P1456'
I also replaced the semicolon with a comma like:
COLUMNNAME IN (REPLACE(@emailid,';' ,','))
Now I got the string like [email protected],[email protected],[email protected],
But IN clause treat it as a single string, So how to append inverted commas in each email ids like below to help IN clause to search?
'[email protected]','[email protected]','[email protected]',