FIND YOUR NEXT FEW LINES

Results for “SQL”

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

500 snippets foundClear filters
SQLiteReporting & grouped calculations

Filter rows before grouping

SQLite: WHERE limits the rows contributing to the aggregate; it differs from filtering completed groups with HAVING.

SQLite✓ Tested
SQLGetting Started

Find missing values with IS NULL

SQL: Use IS NULL rather than equality to test for missing data.

SQL✓ Tested
SQL ServerGetting Started

Find missing values with IS NULL

SQL Server: Use IS NULL rather than equality to test for missing data.

SQL Server✓ Tested
SQLiteGetting Started

Find missing values with IS NULL

SQLite: Use IS NULL rather than equality to test for missing data.

SQLite✓ Tested
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
SQL ServerRelationships & missing data

Find parents whose every child meets a rule

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

SQL Server✓ Tested
SQLiteRelationships & missing data

Find parents whose every child meets a rule

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

SQLite✓ 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
SQL ServerRelationships & missing data

Find parents with at least two child rows

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

SQL Server✓ Tested
SQLiteRelationships & missing data

Find parents with at least two child rows

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

SQLite✓ 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
SQL ServerRelationships & missing data

Find records without any related rows

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

SQL Server✓ Tested