FIND YOUR NEXT FEW LINES

Results for “query”

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

202 snippets foundClear filters
SQLChange & combine data

Insert a row with named columns

Add a record without relying on implicit column order.

INSERT✓ 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
SQLSelect & filter

List distinct values

Remove duplicate category values from a result.

DISTINCT✓ Tested
SQLSelect & filter

Match one of several values

Use IN to avoid repeating equality conditions.

IN✓ Tested
SQL ServerJSON & results

Read a scalar JSON property

Extract a named value using a JSON path.

JSON_VALUE✓ Tested
SQLBulk changes & set operations

Remove duplicate values while keeping the smallest key

SQL: Identify retained keys in a grouped subquery before deleting other copies.

SQL✓ Tested
SQL ServerBulk changes & set operations

Remove duplicate values while keeping the smallest key

SQL Server: Identify retained keys in a grouped subquery before deleting other copies.

SQL Server✓ Tested
PostgresBulk changes & set operations

Remove duplicate values while keeping the smallest key

Postgres: Identify retained keys in a grouped subquery before deleting other copies.

Postgres✓ Tested
SQLiteBulk changes & set operations

Remove duplicate values while keeping the smallest key

SQLite: Identify retained keys in a grouped subquery before deleting other copies.

SQLite✓ Tested
SQLExpressions & aggregates

Replace NULL in a result

Choose a fallback for a missing value.

COALESCE✓ Tested
PostgresRows & writes

Return an inserted row

Read generated data directly from INSERT.

RETURNING✓ Tested