How to use the IN statement in SQL Server
Here is the table structure
Create Table Sample(Id INT,Name Varchar(50))
While I ask such a query, I can get the value
Select * FROM Sample WHERE Id IN ('74','77','79','80')
While I execute the above query, I can’t get the entries related to this table that get an error while executing this error.
DECLARE @s VARCHAR(MAX)
SET @s='74','77','79','80'
Select * FROM Sample WHERE Id IN (@s)
user1307481
source
share