What is the main advantage of using a common table expression (CTE) over a subquery in DB2?

  • CTEs are more efficient than subqueries
  • CTEs can be used recursively
  • CTEs can only be used once in a query
  • Subqueries are more efficient than CTEs
The main advantage of using a CTE over a subquery in DB2 is that CTEs can be used recursively, allowing for more complex and flexible queries. Subqueries cannot achieve this level of recursion. 
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *