---
title: "Sub Queries In sql Server"  
description: "Sub Queries In sql Server"  
author: "Anonymous User"  
published: 2015-12-03  
updated: 2015-12-03  
canonical: https://www.mindstick.com/forum/33678/sub-queries-in-sql-server  
category: "database"  
tags: ["sql server", "sql", "sql server 2008", "sql server 2012"]  
reading_time: 1 minute  

---

# Sub Queries In sql Server

I Want to use [subQuery](https://www.mindstick.com/forum/1279/using-alias-in-subquery) in [Sql server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server) please help me.

## Replies

### Reply by Anonymous User

A Subquery or Inner query or Nested query is a query within another [SQL](https://www.mindstick.com/articles/13115/types-of-keys-in-sql-or-oracle-database) query and embedded within the WHERE clause.

A subquery is used to return data that will be used in the main query as a condition to further restrict the data to be retrieved.

Subqueries can be used with the SELECT, INSERT, UPDATE, and DELETE statements along with the operators like =, <, >, >=, <=, IN, BETWEEN etc.

```
SELECT *  FROM Employee WHERE Emp_ID IN (SELECT Emp_ID FROM Employee WHERE Emp_Sal > 1000)
```

![Sub Queries In sql Server](https://www.mindstick.com/mindstickforums/269fde40-aa29-4875-af70-23dc7aefbefd/images/a4da67e2-d34c-4565-9c70-bcb110420a02.png)


---

Original Source: https://www.mindstick.com/forum/33678/sub-queries-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
