edit-icon download-icon

Nested subquery

Last Updated: Dec 12, 2017

For some complicated query scenarios, you can use the SQL nested query to meet the complicated requirements when the one-level SQL cannot meet the requirements.

The difference between nested subquery and non-nested query is that you need to specify the from condition in the SQL statement. Specifying the keyword from log in the query indicates to read original data from the logs.


  1. * | select sum(pv) from
  2. (
  3. select count(1) as pv from log group by method
  4. )
Thank you! We've received your feedback.