|
Custom Search
| |
|
Using subquery to return a list of values (known as column subquery) Inside This Tutorial Series
Using subquery to return a list of values When the subquery returns a list of values, the subquery is only evaluated once and then the list of values is returned to outer query to use. This kind of subqueries are also known as column subquery. Column subquery is normally used in WHERE clause with an IN operator that tests each value in the returned list from the subquery. Practice #1: Use subquery to return a list of values. Most of the queries in the tutorials need Northwind MySQL database, you can download the database script on this page. /*
Query result set - 11 rows returned: Practice #2: Use inner join to return the same result as using a subquery. Most of the queries in the tutorials need Northwind MySQL database, you can download the database script on this page. /*
Query result set - 77 rows returned: Other tutorials in this category 1. What is subquery |
Copyright © 2024 GeeksEngine.com. All Rights Reserved. This website is hosted by HostGator. No portion may be reproduced without my written permission. Software and hardware names mentioned on this site are registered trademarks of their respective companies. Should any right be infringed, it is totally unintentional. Drop me an email and I will promptly and gladly rectify it. |
Home | Feedback | Terms of Use | Privacy Policy |