Posts in: Databases

LAG, LEAD

Access previous or next row values using LAG and LEAD for comparing current rows with adjacent ones.

Read More →

FIRST_VALUE, LAST_VALUE

Extract the first or last value in a partition using FIRST_VALUE and LAST_VALUE functions.

Read More →

NTILE, PERCENT_RANK, CUME_DIST

Distribute rows into percentiles or calculate cumulative distribution and rank using NTILE, PERCENT_RANK, and CUME_DIST.

Read More →

CTE and WITH Clause

Use Common Table Expressions (CTEs) defined using the WITH clause to simplify and modularize complex SQL queries.

Read More →

Recursive CTEs

Create recursive queries using WITH to handle hierarchical data such as org charts or parent-child structures.

Read More →