FIND YOUR NEXT FEW LINES

Results for “as”

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

2533 snippets foundClear filters
SQLReporting & grouped calculations

Count rows satisfying separate conditions

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

SQL✓ Tested
SQL ServerReporting & grouped calculations

Count rows satisfying separate conditions

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

SQL Server✓ Tested
PostgresReporting & grouped calculations

Count rows satisfying separate conditions

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

Postgres✓ Tested
SQLiteReporting & grouped calculations

Count rows satisfying separate conditions

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

SQLite✓ Tested
CSmall algorithms & bit operations

Count set bits in an unsigned integer

C: Clearing the lowest set bit on each iteration counts only one iteration per set bit.

C✓ Tested
PythonGetting Started

Count the items in a collection

Python: Read the collection’s length instead of hard-coding the loop limit.

Python✓ Tested
JavaGetting Started

Count the items in a collection

Java: Read the collection’s length instead of hard-coding the loop limit.

Java✓ Tested
TypeScriptGetting Started

Count the items in a collection

TypeScript: Read the collection’s length instead of hard-coding the loop limit.

TypeScript✓ Tested
C++Getting Started

Count the items in a collection

C++: Read the collection’s length instead of hard-coding the loop limit.

C++✓ Tested
CGetting Started

Count the items in a collection

C: Read the collection’s length instead of hard-coding the loop limit.

C✓ Tested
SQLGetting Started

Count the rows in a table

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

SQL✓ Tested
SQL ServerGetting Started

Count the rows in a table

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

SQL Server✓ Tested