EN
MySQL - what is subquery?
1
answers
0
points
What is a subquery in MySQL?
1 answer
0
points
A subquery is a query that is nested inside statements (like SELECT , INSERT , UPDATE , DELETE) or inside another subquery.
It is used to return data that will be used in the main query as a condition to further restrict the data to be retrieved.
Practical example:
SELECT * FROM (
SELECT * FROM `table_name`
ORDER BY `column_name` DESC
LIMIT N
) subquery
ORDER BY `column_name` ASC;
0 comments
Add comment