sqlcmd.net validated sql reference

#where

Commands grouped around the same concept, pattern, or recurring problem.

14 commands with this tag Browse related patterns quickly
beginner null-handling MySQL MariaDB SQL Server PostgreSQL SQLite

Check For NULL Values With IS NULL

Use `IS NULL` and `IS NOT NULL` to filter rows based on whether a column has a value.

intermediate null-handling MySQL MariaDB SQL Server PostgreSQL SQLite

Compare Values Including NULLs Safely

Match rows where two values are equal, treating two NULLs as equal instead of unknown.

intermediate filtering MySQL MariaDB SQL Server PostgreSQL SQLite

Filter A Date Range With A Half-Open Boundary

Use an inclusive start and exclusive end to match a whole date range without missing rows that include times.

intermediate joining MySQL MariaDB SQL Server PostgreSQL SQLite

Filter LEFT JOIN Matches In The ON Clause

Put right-table filters in the `ON` clause when you want to keep unmatched left-side rows.

intermediate json MySQL MariaDB SQL Server PostgreSQL SQLite

Filter Rows by a Value Inside a JSON Column

Use each engine's JSON path syntax in a `WHERE` clause to keep only rows whose JSON column contains a matching value.

beginner filtering MySQL MariaDB SQL Server PostgreSQL SQLite

Filter Rows By Pattern With LIKE

Match string columns against a wildcard pattern using `LIKE`.

beginner filtering MySQL MariaDB SQL Server PostgreSQL SQLite

Filter Rows Matching A List With IN

Use `IN` to match a column against a list of values in a single `WHERE` clause.

beginner filtering MySQL MariaDB SQL Server PostgreSQL SQLite

Filter Rows With WHERE

Return only rows that match a condition, with explicit ordering for stable output.

beginner filtering MySQL MariaDB SQL Server PostgreSQL SQLite

Filter Rows Within A Range With BETWEEN

Use `BETWEEN` to match rows where a column falls within an inclusive lower and upper bound.

beginner filtering MySQL MariaDB SQL Server PostgreSQL SQLite

Filter Text Case-Insensitively

Compare normalized text values with LOWER or UPPER so matching does not depend on stored capitalization.

beginner data-quality MySQL MariaDB SQL Server PostgreSQL SQLite

Find Rows That Violate A Data Rule

Use a `WHERE` predicate to list rows that already break a business or constraint rule.

intermediate filtering MySQL MariaDB SQL Server PostgreSQL SQLite

Match Multiple Columns at Once With Row Value Constructors

Use `(col_a, col_b) IN ((v1, v2), (v3, v4))` to filter on combinations of columns simultaneously — cleaner and less error-prone than chaining `AND`/`OR` conditions.

intermediate updating MySQL MariaDB SQL Server PostgreSQL SQLite

Update Rows Selected By A Subquery

Use a subquery in the `WHERE` clause of an `UPDATE` to restrict which rows are modified based on data from another table.

intermediate grouping MySQL MariaDB SQL Server PostgreSQL SQLite

Use WHERE Before GROUP BY And HAVING After

`WHERE` filters individual rows before grouping. `HAVING` filters grouped results after aggregates are computed.