CTE
Meaning in databases & SQL, with examples
In databases & SQL, CTE means: Common table expression: a named temporary result defined with WITH at the start of a query, which the main query can then use like a table.
In Turkish: ortak tablo ifadesi, CTE
How it is used
CTEs make long queries readable by splitting them into named steps. A recursive CTE (WITH RECURSIVE in PostgreSQL and MySQL) can walk tree data such as category hierarchies or org charts. Developers often say 'pull that out into a CTE'.
Example sentences
I moved the monthly totals into a CTE so the final SELECT is easier to read.
A recursive CTE returns the whole category tree in one query.
Common collocations
- WITH clause
- recursive CTE
- use a CTE
- chain CTEs
Related terms
This word in other fields
The same English word can have a different meaning in another field:
More terms: SQL Statements and Queries
Practise with graded reading
Reading at the right level is the fastest way to make new words stick. Pick free English books by level:
