Results for “string_agg”
Small, practical examples. Search by task or narrow things down below.
Extract a substring with an explicit count
C++: The second substr argument is a length rather than an ending index.
C++✓ Tested
Extract a substring with range syntax
C#: C# range ends are exclusive; indices operate on UTF-16 code units.
C#✓ Tested
Extract part of a string
Use one-based positions with substr.
substr✓ Tested
Filter aggregate groups
Keep only categories with multiple products.
HAVING✓ Tested
Filter groups after aggregation
SQL: Use HAVING to test a group’s calculated total.
SQL✓ Tested
Filter groups after aggregation
SQL Server: Use HAVING to test a group’s calculated total.
SQL Server✓ Tested
Filter groups after aggregation
Postgres: Use HAVING to test a group’s calculated total.
Postgres✓ Tested
Filter groups after aggregation
SQLite: Use HAVING to test a group’s calculated total.
SQLite✓ 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
Find a substring
Check the result of std::string::find against npos.
C++✓ Tested
Find a substring
Use strstr to find a literal substring in a C string.
C✓ Tested
Group strings by their length
Java: Choose a TreeMap supplier when group keys must have deterministic order.
Java✓ Tested