FIND YOUR NEXT FEW LINES

Results for “SQL Server”

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

502 snippets foundClear filters
SQLiteGetting Started

Require two filtering conditions

SQLite: Combine category and quantity conditions with AND.

SQLite✓ Tested
SQLSubqueries & ranked selection

Return all rows tied for the maximum in a group

SQL: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.

SQL✓ Tested
SQLiteSubqueries & ranked selection

Return all rows tied for the maximum in a group

SQLite: An equality comparison with a grouped maximum retains ties rather than choosing one arbitrary row.

SQLite✓ Tested
SQLReporting & grouped calculations

Return zero for a sum over no rows

SQL: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.

SQL✓ Tested
SQLiteReporting & grouped calculations

Return zero for a sum over no rows

SQLite: SUM produces NULL for an empty input; COALESCE supplies the desired reporting default.

SQLite✓ Tested
SQLGetting Started

Run a first SELECT query

SQL: Return a literal value without creating a table.

SQL✓ Tested
SQLiteGetting Started

Run a first SELECT query

SQLite: Return a literal value without creating a table.

SQLite✓ Tested
SQLText cleanup & matching

Search for a literal LIKE wildcard

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

SQL✓ Tested
SQLiteText cleanup & matching

Search for a literal LIKE wildcard

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

SQLite✓ Tested
SQLWindow analytics

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

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

SQL✓ Tested
SQLiteWindow analytics

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

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

SQLite✓ Tested
SQLGetting Started

Select values in an inclusive range

SQL: BETWEEN includes both endpoints of the range.

SQL✓ Tested