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:
xxxxxxxxxx
1
SELECT * FROM (
2
SELECT * FROM `table_name`
3
ORDER BY `column_name` DESC
4
LIMIT N
5
) subquery
6
ORDER BY `column_name` ASC;
0 commentsShow commentsAdd comment