Standard

SQL WHERE Clause Builder

Add conditions visually and get a combined WHERE clause.

Advertisement

About this tool

Builds a SQL WHERE clause from a simple form — pick a column, a comparison, and a value, add more conditions joined with AND/OR — instead of hand-typing quotes and operators and getting the syntax slightly wrong. Text values are quoted for you, with apostrophes escaped (O'Neill becomes 'O''Neill'), while plain numbers, TRUE, FALSE and NULL are left unquoted. A number with a leading zero, such as a phone number, is kept as text so the zero isn't lost.

For IN and NOT IN, type the values separated by commas (UK, IE, FR); for BETWEEN, type the low and high values separated by a comma (10, 50). BETWEEN includes both ends. To find missing values use IS NULL, because = NULL never matches anything in SQL.