IT lexicon › Database › CTE

CTE Common Table Expression

Database På svenska → Updated: 2026-05-24

SQL construct WITH foo AS (SELECT ...) that lets you name intermediate results in a query.

Makes complex queries readable — builds up in steps instead of nested subqueries. Also recursive CTEs for tree structures (org charts, comment threads). Modern SQL standard feature since 2008.

← Back to the lexicon