Tag
SQL
Articles connected to sql.
Editorial
SQL articles
Use PostgreSQL `LAG()` to Compare Each Row with the Previous Row Without Losing Detail
Use PostgreSQL’s `LAG()` window function to add a previous-row value and a row-by-row difference to detailed query results. Build a reproducible time-series example, define a stable row order, and handle the first row in each group.
Use PostgreSQL Views to Give Application Queries a Stable, Reusable Interface
Build a PostgreSQL view over orders and customers, query it through an application-facing interface, and test changes to its published columns with representative SQL.
Use PostgreSQL Window Functions to Rank Rows Within Groups Without Losing Detail
Rank every row inside its group with `ROW_NUMBER()`, `RANK()`, or `DENSE_RANK()`—without collapsing the result to one row per group.
How to Use Amazon Athena with DuckDB and TypeScript
Amazon Athena introduces a DuckDB-powered query engine. Learn how to configure a workgroup, execute SQL remotely with TypeScript, and retrieve results without managing a database server.