Results for “count”
Small, practical examples. Search by task or narrow things down below.
Count whitespace-separated words
Linux Commands: Use wc -w with standard input to omit the filename column.
Linux Commands✓ Tested
Count word frequencies
Use Map.merge to count repeated words in Java.
Java✓ Tested
Count word frequencies
Accumulate word counts in an ordered C++ map.
C++✓ Tested
Count words using a Map
Update a keyed counter without losing its value type.
Map✓ Tested
Count words with GroupBy
Group repeated C# words and print ordered counts.
C#✓ Tested
Distinguish row count from non-null value count
SQL: COUNT(*) includes every row while COUNT(column) skips NULL values.
SQL✓ Tested
Distinguish row count from non-null value count
SQL Server: COUNT(*) includes every row while COUNT(column) skips NULL values.
SQL Server✓ Tested
Distinguish row count from non-null value count
Postgres: COUNT(*) includes every row while COUNT(column) skips NULL values.
Postgres✓ Tested
Distinguish row count from non-null value count
SQLite: COUNT(*) includes every row while COUNT(column) skips NULL values.
SQLite✓ Tested
Extract a substring with an explicit count
C++: The second substr argument is a length rather than an ending index.
C++✓ Tested
Find a commit that changed the count of a text string
Git: The pickaxe -S option finds commits that add or remove occurrences of a literal string.
Git✓ Tested
Include zero counts for missing relationships
SQL: Count the non-null child key after a left join so a missing relationship produces zero.
SQL✓ Tested