FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Get the latest row in each group
Select one ordered row per key with DISTINCT ON.
DISTINCT ON✓ Tested
Insert or update on a key conflict
Use a unique key to update an existing row.
ON CONFLICT✓ Tested
Inspect deleted rows
Return values from the rows a DELETE removes.
DELETE✓ Tested
Return an inserted row
Read generated data directly from INSERT.
RETURNING✓ Tested
Search text without case sensitivity
Match a pattern with PostgreSQL ILIKE.
ILIKE✓ Tested