Subqueries can be used almost any place where an expression can be used, but for tuning purposes, consider a divide and conquer approach using separate queries:• CASE expressions
• SELECT statements
• VALUES clauses of INSERT statements
• WHERE clauses
• ORDER BY clauses