A subquery can be used anywhere an expression can be used in the SELECT clause. Recommended Articles. I feel like I’m close. In the HAVING clause, as a group selector. A subquery can have only one column in the SELECT clause, unless multiple columns are in the main query for the subquery to compare its selected columns. To use this subquery, you use the IN operator in the WHERE clause. You simply include the subquery as you would any other column expression. If a subquery returns a single value, it can be used anywhere an expression is used. The following example finds the salaries of all employees, their average salary, and the difference between the salary of each employee and the average salary. This is in agreement with the SQL Standard, which says: 17) Case: a) If the i-th in the