FIND YOUR NEXT FEW LINES

Results for “SQL”

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

500 snippets foundClear filters
SQLiteQueries & text

Search a small FTS5 table

Use SQLite’s full-text index to match a term.

FTS5✓ Tested
PostgresText cleanup & matching

Search for a literal LIKE wildcard

Postgres: Declare an escape character so a percent sign in the pattern is literal.

Postgres✓ Tested
PostgresRows & writes

Search text without case sensitivity

Match a pattern with PostgreSQL ILIKE.

ILIKE✓ Tested
SQLSelect & filter

Select an inclusive range

Find rows with values between two endpoints.

BETWEEN✓ Tested
SQLSelect & filter

Select specific columns

Read only the fields a result needs.

SELECT✓ Tested
SQL ServerSelect & page

Select the highest values with TOP

Limit an ordered SQL Server result.

TOP✓ Tested
PostgresWindow analytics

Select the top row in each group with a tie-breaker

Postgres: Filter an outer query on ROW_NUMBER because window functions are not evaluated in WHERE.

Postgres✓ Tested
PostgresGetting Started

Select values in an inclusive range

Postgres: BETWEEN includes both endpoints of the range.

Postgres✓ Tested
SQL ServerJSON & results

Serialize query rows as JSON

Return a JSON array directly from a SELECT.

FOR JSON✓ Tested
SQLiteJSON data

Set a JSON property

Create an updated JSON document from existing text.

json_set✓ Tested
PostgresWindow analytics

Show a group total beside each detail row

Postgres: A partitioned aggregate preserves detail rows instead of collapsing them with GROUP BY.

Postgres✓ Tested
PostgresSubqueries & ranked selection

Sort preferred rows ahead of other rows

Postgres: A CASE ordering key expresses business priority before a stable secondary sort.

Postgres✓ Tested