FIND YOUR NEXT FEW LINES

Results for “ps”

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

442 snippets foundClear filters
PostgresReporting & grouped calculations

Count distinct values within a result

Postgres: COUNT DISTINCT counts distinct non-null values.

Postgres✓ Tested
PowerShellCollections & objects

Count items by group

Group repeated values and report each count.

Group-Object✓ Tested
PostgresReporting & grouped calculations

Count rows satisfying separate conditions

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

Postgres✓ Tested
PostgresGetting Started

Count the rows in a table

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

Postgres✓ Tested
PowerShellFiles & paths

Create a directory if needed

Ensure a directory exists before writing output.

New-Item✓ Tested
PowerShellGetting Started

Create a portable relative path

PowerShell: Create a portable relative path using PowerShell 7.

PowerShell✓ Tested
C#LINQ transformations

Create a reusable one-to-many lookup

C#: ToLookup groups values by key and returns an empty sequence for an unknown key.

C#✓ Tested
PostgresGetting Started

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
PowerShellGetting Started

Create an array of text values

PowerShell: Create an array of text values using PowerShell 7.

PowerShell✓ Tested
Linux CommandsFiles & permissions

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
SQLSchema design & transactions

Create an index for an equality filter

SQL: A nonunique index can support lookups on a frequently filtered column.

SQL✓ Tested
SQL ServerSchema design & transactions

Create an index for an equality filter

SQL Server: A nonunique index can support lookups on a frequently filtered column.

SQL Server✓ Tested