Results for “table variable”
Small, practical examples. Search by task or narrow things down below.
Count distinct values within a result
SQL: COUNT DISTINCT counts distinct non-null values.
SQL✓ Tested
Count items by group
Group repeated values and report each count.
Group-Object✓ Tested
Count rows per category
Aggregate rows sharing the same category.
GROUP BY✓ Tested
Count rows satisfying separate conditions
SQL: SUM over CASE expressions calculates several conditional counts in one scan.
SQL✓ Tested
Create a directory if needed
Ensure a directory exists before writing output.
New-Item✓ Tested
Create an array of text values
PowerShell: Create an array of text values using PowerShell 7.
PowerShell✓ 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 matching filter and ordering columns
SQL: Place the equality-filter column before the ordering column in this composite index.
SQL✓ Tested
Create an object with named properties
PowerShell: Create an object with named properties using PowerShell 7.
PowerShell✓ Tested
Define a function with a parameter
PowerShell: Define a function with a parameter using PowerShell 7.
PowerShell✓ Tested
Define a function with a typed parameter
Accept a name and return a greeting.
function✓ Tested
Delete one matching row
Remove a selected record and inspect what remains.
DELETE✓ Tested