What Is a Subquery in MySQL

Q

What Is a Subquery in MySQL?

✍: FYIcenter.com

A

A subquery is a SELECT statement used as part of the selection criteria of the main SELECT statement. The subquery specified in the WHERE clause will be evaluated repeated on each row of the selection base table. The output of the subquery will be used in the final evaluation of the criteria. Usually, subqueries are used in the following Boolean operations:

  • "expression IN (subquery)"
  • "expression NOT IN (subquery)"
  • "EXISTS (subquery)"
  • "NOT EXISTS (subquery)"

 

Using Subqueries with the IN Operator in MySQL

Assign Names to Query Output Columns in MySQL

SELECT Statements with JOIN and Subqueries in MySQL

⇑⇑ MySQL Database Tutorials

2017-09-17, 1606🔥, 0💬