#SQL

Notes related to SQL.

131 notes tagged

SQL

Recursive CTEs

Query a hierarchy of unknown depth, generate a series of rows, or follow a chain of references - all with one self referencing CTE.

Read more
SQL

UNION and UNION ALL

Stacking two result sets on top of each other. Learn the column compatibility rules, why UNION ALL is faster, and where ORDER BY belongs.

Read more