SUB QUERIES IN SQL SERVER

Ankit Singh

Total Post:341

Points:2389
Posted by  Ankit Singh
 518  View(s)
Ratings:
Rate this:
I Want to use subQuery in Sql server please help me.
  1. aditya kumar Patel

    Post:254

    Points:1810
    Re: Sub Queries In sql Server

    A Subquery or Inner query or Nested query is a query within another SQL 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)

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!