FIND YOUR NEXT FEW LINES

Results for “SQL Server”

Small, practical examples. Search by task or narrow things down below.

502 snippets foundClear filters
PostgresRows & writes

Insert or update on a key conflict

Use a unique key to update an existing row.

ON CONFLICT✓ Tested
PostgresRows & writes

Inspect deleted rows

Return values from the rows a DELETE removes.

DELETE✓ Tested
PostgresRelationships & missing data

Join a parent to pre-aggregated totals

Postgres: Aggregate the child rows first to produce at most one joined row per parent.

Postgres✓ Tested
PostgresGetting Started

Join related rows from two tables

Postgres: Match a category key to its display label with an explicit join condition.

Postgres✓ Tested
PostgresWindows & text

Join text rows in a chosen order

Combine values using string_agg.

string_agg✓ Tested
PostgresRelationships & missing data

Join through a lookup table

Postgres: Use explicit aliases and join keys when enriching records through two relationships.

Postgres✓ Tested
SQLiteQueries & text

Join values with a delimiter

Concatenate rows in a specified order.

group_concat✓ Tested
PostgresConstraints & defaults

Keep children while clearing a deleted relationship

Postgres: ON DELETE SET NULL requires a nullable foreign-key column.

Postgres✓ Tested
PostgresRelationships & missing data

Keep parent rows while filtering joined children

Postgres: Put a child filter in ON when unmatched parents must remain in the result.

Postgres✓ Tested
PostgresGetting Started

Keep rows matching a condition

Postgres: Use WHERE to select rows with a particular category.

Postgres✓ Tested
SQLJoins & subqueries

Keep unmatched rows with LEFT JOIN

Show every product even when stock is missing.

LEFT JOIN✓ Tested
SQLExpressions & aggregates

Label rows with CASE

Derive a readable label from a condition.

CASE✓ Tested