The sel_sub.sql command file

The following example uses a subquery to query. This self-join uses a correlated subquery to retrieve and list the 10 highest-priced items ordered.
SELECT order_num, total_price 
   FROM items a
   WHERE 10 >
      (SELECT COUNT (*) 
         FROM items b
         WHERE b.total_price < a.total_price)
   ORDER BY total_price;

Copyright© 2019 HCL Technologies Limited