Understanding Subqueries


Note

Version Requirements Support for subqueries was introduced in MySQL 4.1. To use the SQL described in this chapter, you must be running MySQL 4.1 or later.


SELECT statements are SQL queries. All the SELECT statements you have seen thus far are simple queries: single statements retrieving data from individual database tables.

New Term

Query Any SQL statement. However, the term is usually used to refer to SELECT statements.


SQL also enables you to create subqueries: queries that are embedded into other queries. Why would you want to do this? The best way to understand this concept is to look at a couple of examples.




MySQL Crash Course
MySQL Crash Course
ISBN: 0672327120
EAN: 2147483647
Year: 2004
Pages: 214
Authors: Ben Forta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net