Summary

By simple definition and general concept, a subquery is a query that is performed within another query to place further conditions on a query. A subquery can be used in an SQL statement's WHERE clause or HAVING clause. Queries are typically used within other queries (Data Query Language), but can also be used in the resolution of Data Manipulation Language statements such as INSERT, UPDATE, and DELETE. All basic rules for DML apply when using subqueries with DML commands.

The subquery's syntax is virtually the same as that of a standalone query, with a few minor restrictions. One of these restrictions is that the ORDER BY clause cannot be used within a subquery; a GROUP BY clause can be used, however, which renders virtually the same effect. Subqueries are used to place conditions that are not necessarily known for a query, providing more power and flexibility with SQL.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset