© Daniel Bartholomew 2017
Daniel BartholomewMariaDB and MySQL Common Table Expressions and Window Functions Revealedhttps://doi.org/10.1007/978-1-4842-3120-3_1

1. Basics of Common Table Expressions

Daniel Bartholomew
(1)
Raleigh, North Carolina, USA
 
Common Table Expressions (CTEs) are one of the new SQL features introduced in MariaDB 10.2 and MySQL 8.0. This chapter will introduce CTEs, describe the two types, and explain the basic syntax. CTEs are named temporary result sets that only last for the duration of the query they are in. In some respects, they are similar to derived tables, but they are more powerful. They can refer to themselves recursively and can be referenced multiple times in the same query. They also enable column grouping and ...

Get MariaDB and MySQL Common Table Expressions and Window Functions Revealed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.