FIND YOUR NEXT FEW LINES

Results for “SQL Server”

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

502 snippets foundClear filters
SQLiteSchema design & transactions

Commit multiple related changes together

SQLite: The first transaction prepares the fixtures. The second commits both updates as one unit.

SQLite✓ Tested
SQLSubqueries & ranked selection

Compare a row with its own group average

SQL: A correlated aggregate computes a different comparison value for each group.

SQL✓ Tested
SQLiteSubqueries & ranked selection

Compare a row with its own group average

SQLite: A correlated aggregate computes a different comparison value for each group.

SQLite✓ Tested
SQLReporting & grouped calculations

Compute an integer weighted average

SQL: Multiply before summing and guard a zero total weight with NULLIF.

SQL✓ Tested
SQLiteReporting & grouped calculations

Compute an integer weighted average

SQLite: Multiply before summing and guard a zero total weight with NULLIF.

SQLite✓ Tested
SQLBulk changes & set operations

Copy selected rows into another table

SQL: INSERT SELECT performs a set-based copy with an explicit destination column list.

SQL✓ Tested
SQLiteBulk changes & set operations

Copy selected rows into another table

SQLite: INSERT SELECT performs a set-based copy with an explicit destination column list.

SQLite✓ Tested
SQLReporting & grouped calculations

Count distinct values within a result

SQL: COUNT DISTINCT counts distinct non-null values.

SQL✓ Tested
SQLiteReporting & grouped calculations

Count distinct values within a result

SQLite: COUNT DISTINCT counts distinct non-null values.

SQLite✓ Tested
SQLReporting & grouped calculations

Count rows satisfying separate conditions

SQL: SUM over CASE expressions calculates several conditional counts in one scan.

SQL✓ Tested
SQLiteReporting & grouped calculations

Count rows satisfying separate conditions

SQLite: SUM over CASE expressions calculates several conditional counts in one scan.

SQLite✓ Tested
SQLGetting Started

Count the rows in a table

SQL: COUNT(*) includes every row, including rows with NULL columns.

SQL✓ Tested