FIND YOUR NEXT FEW LINES

Results for “unique”

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

51 snippets foundClear filters
Bash ScriptsFiles & reliability

Clean up a temporary directory automatically

Use an EXIT trap so temporary files are removed when the script ends.

mktemp✓ Tested
SQLSchema design & transactions

Create an index for an equality filter

SQL: A nonunique index can support lookups on a frequently filtered column.

SQL✓ Tested
SQL ServerSchema design & transactions

Create an index for an equality filter

SQL Server: A nonunique index can support lookups on a frequently filtered column.

SQL Server✓ Tested
PostgresSchema design & transactions

Create an index for an equality filter

Postgres: A nonunique index can support lookups on a frequently filtered column.

Postgres✓ Tested
SQLiteSchema design & transactions

Create an index for an equality filter

SQLite: A nonunique index can support lookups on a frequently filtered column.

SQLite✓ Tested
JavaFile operations & binary data

Create and clean up a temporary file

Java: Create a unique file and remove it in finally even when the operation fails.

Java✓ Tested
SQLWindow analytics

Divide an ordered result into numbered buckets

SQL: NTILE distributes rows across buckets; include a unique tie-breaker for deterministic assignment.

SQL✓ Tested
SQL ServerWindow analytics

Divide an ordered result into numbered buckets

SQL Server: NTILE distributes rows across buckets; include a unique tie-breaker for deterministic assignment.

SQL Server✓ Tested
PostgresWindow analytics

Divide an ordered result into numbered buckets

Postgres: NTILE distributes rows across buckets; include a unique tie-breaker for deterministic assignment.

Postgres✓ Tested
SQLiteWindow analytics

Divide an ordered result into numbered buckets

SQLite: NTILE distributes rows across buckets; include a unique tie-breaker for deterministic assignment.

SQLite✓ Tested
PostgresRows & writes

Get the latest row in each group

Select one ordered row per key with DISTINCT ON.

DISTINCT ON✓ Tested
PostgresRows & writes

Insert or update on a key conflict

Use a unique key to update an existing row.

ON CONFLICT✓ Tested