O'Reilly logo

Microsoft SQL Server 2012 T-SQL by Debra Aaron, Tom Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9 – Sub-query Functions

“An invasion of Armies can be resisted, but not an idea whose time has come.”

- Victor Hugo

An IN List is much like a Subquery

image

SELECT *

FROM    Employee_Table

WHERE Dept_No IN (100, 200) ;

image

This query is very simple and easy to understand. It uses an IN List to find all Employees who are in Dept_No 100 or Dept_No 200.

An IN List Never has Duplicates – Just like a Subquery

image

What is going on with this IN List? Why in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required