---
title: "Use Intersect in sql server"  
description: "Use Intersect in sql server"  
author: "Anonymous User"  
published: 2016-03-08  
updated: 2016-03-08  
canonical: https://www.mindstick.com/forum/34040/use-intersect-in-sql-server  
category: "database"  
tags: ["sql server", "sql"]  
reading_time: 1 minute  

---

# Use Intersect in sql server

We want to use Intersect in [sql server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server).how will do this please help me.

## Replies

### Reply by Anonymous User

**Intersect:** The intersect statement is used to fetch the common records between the tables. Here we have two tables. Both tables have similar kinds of records.

```
CREATE TABLE ProductStock
(
ProductId INT PRIMARY KEY IDENTITY(1,1),
ProductName VARCHAR(100),
ManufacturedBy VARCHAR(100),
StockQty BIGINT,
LastUpdated date
)
Go
CREATE TABLE ProductOrder
(
OrderId INT PRIMARY KEY IDENTITY(1,1),
ProductId int,
ProductName VARCHAR(100),
ManufacturedBy VARCHAR(100),
OrderQty BIGINT,
OrderDate date
)
```

```
ProductStock :  ProductOrder: INTERSECT QUERY : SELECT ProductId,ProductName,ManufacturedBy FROM ProductStock
INTERSECT
SELECT ProductId,ProductName,ManufacturedBy FROM ProductOrder
```

```
Result : 
```


---

Original Source: https://www.mindstick.com/forum/34040/use-intersect-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
