What is a CTE?
A CTE (Common Table Expression) is a temporary result set defined using the
WITH
clause.
It can be referenced like a table in your main query.
CTEs make SQL:
-
Easier to read
-
Modular (reuse logic)
-
Helpful for recursive queries, too
✅ Basic Syntax
____________________________________________________________________________
Find employees earning above the average salary.
✅ Query Using CTE:
No comments:
Post a Comment