FIND YOUR NEXT FEW LINES

Results for “table variable”

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

513 snippets foundClear filters
SQLRelationships & missing data

Find parents whose every child meets a rule

SQL: Combine existence with the absence of a violating child to exclude parents with no children.

SQL✓ Tested
SQLRelationships & missing data

Find parents with at least two child rows

SQL: Use a correlated count when testing a per-parent threshold.

SQL✓ Tested
SQLRelationships & missing data

Find records without any related rows

SQL: NOT EXISTS avoids the NULL pitfalls of NOT IN when the subquery column can be missing.

SQL✓ Tested
SQLBulk changes & set operations

Find rows in the first result but not the second

SQL: EXCEPT calculates a distinct result-set difference.

SQL✓ Tested
SQLBulk changes & set operations

Find rows shared by two query results

SQL: INTERSECT compares complete selected rows and removes duplicates.

SQL✓ Tested
SQLJoins & subqueries

Find rows with a related record

Use EXISTS without duplicating the outer rows.

EXISTS✓ Tested
GitCommits & history

Find the commit responsible for a line

Inspect line attribution in a stable machine-readable format.

blame✓ Tested
SQL ServerDates & text

Find the final day of a month

Use EOMONTH without manually calculating month length.

EOMONTH✓ Tested
PowerShellArray operations

Find the index of an array item

PowerShell: Array.IndexOf returns -1 when the requested item is absent.

PowerShell✓ Tested
PowerShellDates & numeric validation

Find the number of days in a month

PowerShell: DaysInMonth handles leap-year February correctly.

PowerShell✓ Tested
SQLSubqueries & ranked selection

Find the second-highest distinct value

SQL: Select the maximum below the overall maximum to skip ties at the top.

SQL✓ Tested
PowerShellDates & numeric validation

Format a bounded duration as hours minutes and seconds

PowerShell: TimeSpan can format duration components with escaped separators.

PowerShell✓ Tested