How to Work with IN Operator in SQL

In this article I am going to explain how to work with IN Operator in SQL.IN Operator
  • 1789

Introduction

In this article I am going to explain how to work with IN operator in SQL. IN operator is used to test whether an expression is equal to a value in a list of expression. We use IN operator with WHERE clause. We use it to find the specific record into result set from table stored in database. It is used to fetch specific row or specific record based on comparison.

Example

SELECT * FROM dbo.mcninvoices
WHERE invoiceid IN (1,4,6,7)

Output

Clipboard12.jpg


© 2020 DotNetHeaven. All rights reserved.