Results for “ps”
Small, practical examples. Search by task or narrow things down below.
Count distinct values within a result
Postgres: COUNT DISTINCT counts distinct non-null values.
Postgres✓ Tested
Count items by group
Group repeated values and report each count.
Group-Object✓ Tested
Count rows satisfying separate conditions
Postgres: SUM over CASE expressions calculates several conditional counts in one scan.
Postgres✓ Tested
Count the rows in a table
Postgres: COUNT(*) includes every row, including rows with NULL columns.
Postgres✓ Tested
Create a directory if needed
Ensure a directory exists before writing output.
New-Item✓ Tested
Create a portable relative path
PowerShell: Create a portable relative path using PowerShell 7.
PowerShell✓ Tested
Create a reusable one-to-many lookup
C#: ToLookup groups values by key and returns an empty sequence for an unknown key.
C#✓ Tested
Create a table and insert its first row
Postgres: Define column types and a primary key, then insert one row using an explicit column list.
Postgres✓ Tested
Create an array of text values
PowerShell: Create an array of text values using PowerShell 7.
PowerShell✓ Tested
Create an empty file
Linux Commands: Use touch to create a file when absent; an existing file keeps its contents but gets updated timestamps.
Linux Commands✓ Tested
Create an index for an equality filter
SQL: A nonunique index can support lookups on a frequently filtered column.
SQL✓ Tested
Create an index for an equality filter
SQL Server: A nonunique index can support lookups on a frequently filtered column.
SQL Server✓ Tested