DECLARE @MyList TABLE (Value INT)
INSERT INTO @MyList VALUES (1)
INSERT INTO @MyList VALUES (2)
INSERT INTO @MyList VALUES (3)
INSERT INTO @MyList VALUES (4)
SELECT *
FROM MyTable
WHERE MyColumn IN (SELECT Value FROM @MyList)
More Related Contents:
- Convert text to system date format [duplicate]
- to select all the employees who have joined most recently under king
- How do I escape a single quote in SQL Server?
- Simple way to transpose columns and rows in SQL?
- Count work days between two dates
- Only inserting a row if it’s not already there
- Unpivot with column name
- Selecting data from two different servers in SQL Server
- Maximum size for a SQL Server Query? IN clause? Is there a Better Approach [duplicate]
- SQL JOIN vs IN performance?
- Most efficient way in SQL Server to get date from date+time?
- Convert varchar into datetime in SQL Server
- TSQL Pivot without aggregate function
- How to generate a range of dates in SQL Server
- SQL RANK() versus ROW_NUMBER()
- Check if a row exists, otherwise insert
- Drop all the tables, stored procedures, triggers, constraints and all the dependencies in one sql statement
- How do I perform a GROUP BY on an aliased column in SQL Server?
- Is it possible to perform multiple updates with a single UPDATE SQL statement?
- Incorrect syntax near the keyword ‘with’…previous statement must be terminated with a semicolon
- Alter user defined type in SQL Server
- Best equivalent for IsInteger in SQL Server
- Store multiple bit values in a single table column
- SQL Server equivalent to MySQL enum data type?
- Comma separated values in a database field
- Grant SELECT permission on a view, but not on underlying objects
- SQL – Call Stored Procedure for each record
- WITH CHECK ADD CONSTRAINT followed by CHECK CONSTRAINT vs. ADD CONSTRAINT
- Sql Server : How to use an aggregate function like MAX in a WHERE clause
- Date serial in SQL?