Suresh Kumar
What is sub query and its properties?
By Suresh Kumar in SQL Server on Nov 09 2017
  • Nithya Mathan
    Nov, 2017 15

    In simple words , Sub query is a collection of queries like nested queries ( A query with another query embedded with another queries with in the "Where" class.The use of Sub query is used to return the data that is used in the main query then the condition to restrict the data. Properties: The query must contain the two or more sub queries.It must be enclosed with the parenthesis.

    • 2
  • Ankur Sharma
    Jan, 2018 22

    it is a query under query with in " where" condition

    • 1
  • Surya
    Jan, 2018 18

    Sub Query - A Query which is inside where clause. It returns data which is used in the main query to execute.Sub query is always executes first. More than one sub query in a single query. It does not contain order by clause

    • 0
  • Rupesh Kumar
    Jan, 2018 14

    Query with in query that is called Sub query.sub query also called INNER QUERY.For example see the below query:SELECT p.productid, p.productName FROM products p WHERE p.productid IN(SELECT pd.productidFROM productdetails pdWHERE pd.quantity > 5); it is the inner query in this statement. (SELECT pd.productid FROM productdetails pd WHERE pd.quantity > 5)

    • 0
  • Saravanakumar Sekaran
    Jan, 2018 3

    A subquery is also known as a nested query which means query inside another query. 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.Properties of Sub-Query A subquery should be boxed within the parenthesis. A subquery should be placed within the right hand of the comparison operator, and a subquery cannot contain an ORDER BY clause. A query can contain more than one sub-queries.

    • 0
  • Anil Kumar Murmu
    Dec, 2017 24

    Subquery is a nested query, not necessarily defined by a where clause only. Subquery act as a filter condition for the primary query

    • 0
  • Mukesh Sagar
    Nov, 2017 17

    A Subquery or Inner query or a 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.

    • 0
  • Suresh Kumar
    Nov, 2017 9

    ''

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS