Results for “up”
Small, practical examples. Search by task or narrow things down below.
Compute an integer weighted average
SQLite: Multiply before summing and guard a zero total weight with NULLIF.
SQLite✓ Tested
Copy a file to a folder
Create a backup folder if needed, then copy a file into it while preserving its modification time and permission bits.
file✓ Tested
Count a button’s falling edge in the main loop
Arduino / C: Compare each reading with the previous state to detect transitions.
Arduino / C✓ 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
Count rows satisfying separate conditions
Postgres: SUM over CASE expressions calculates several conditional counts in one scan.
Postgres✓ Tested
Count rows satisfying separate conditions
SQLite: SUM over CASE expressions calculates several conditional counts in one scan.
SQLite✓ Tested