Results for “head”
Small, practical examples. Search by task or narrow things down below.
Copy selected rows into another table
SQL: INSERT SELECT performs a set-based copy with an explicit destination column list.
SQL✓ Tested
Copy selected rows into another table
SQL Server: INSERT SELECT performs a set-based copy with an explicit destination column list.
SQL Server✓ Tested
Copy selected rows into another table
Postgres: INSERT SELECT performs a set-based copy with an explicit destination column list.
Postgres✓ Tested
Copy selected rows into another table
SQLite: INSERT SELECT performs a set-based copy with an explicit destination column list.
SQLite✓ Tested
Count day boundaries between dates
Compare date values with DATEDIFF.
DATEDIFF✓ Tested
Count distinct values within a result
SQL: COUNT DISTINCT counts distinct non-null values.
SQL✓ Tested
Count distinct values within a result
SQL Server: COUNT DISTINCT counts distinct non-null values.
SQL Server✓ Tested
Count distinct values within a result
Postgres: COUNT DISTINCT counts distinct non-null values.
Postgres✓ Tested
Count distinct values within a result
SQLite: COUNT DISTINCT counts distinct non-null values.
SQLite✓ Tested
Count rows per category
Aggregate rows sharing the same category.
GROUP BY✓ Tested
Count rows satisfying separate conditions
SQL: SUM over CASE expressions calculates several conditional counts in one scan.
SQL✓ Tested
Count rows satisfying separate conditions
SQL Server: SUM over CASE expressions calculates several conditional counts in one scan.
SQL Server✓ Tested