- CTEs are used to make the query easier.
- Whenever there are too many joins are being used in a query then we can use CTEs to make it simple.
Example
With test AS ( SELECT col1,col2 FROM table ) SELECT * FROM test
Example
With test AS ( SELECT col1,col2 FROM table ) SELECT * FROM test