The subquery returns all office codes of the offices located in the USA. SELECTĬountry = 'USA') Code language: SQL (Structured Query Language) ( sql ) A subquery can be used anywhere that expression is used and must be closed in parentheses.įor example, the following query uses a subquery to return the employees who work in the offices located in the USA. Also, a subquery can be nested within another subquery.Ī MySQL subquery is called an inner query while the query that contains the subquery is called an outer query. Introduction to the MySQL SubqueryĪ MySQL subquery is a query nested within another query such as SELECT, INSERT, UPDATEor DELETE. Summary: in this tutorial, we will show you how to use the MySQL subquery to write complex queries and explain the correlated subquery concept.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |