FIND YOUR NEXT FEW LINES

Results for “SQLite”

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

250 snippets foundClear filters
SQLGetting Started

Filter groups after aggregation

SQL: Use HAVING to test a group’s calculated total.

SQL✓ Tested
SQLReporting & grouped calculations

Filter rows before grouping

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

SQL✓ Tested
SQLSelect & filter

Filter rows with WHERE

Keep products below a chosen price.

WHERE✓ Tested
SQLGetting Started

Find missing values with IS NULL

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

SQL✓ 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
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
SQLiteDates & time

Find the first day of a month

Round a date to its calendar month boundary.

date✓ 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