About this tool
Build a SQL WHERE clause from plain conditions with correct identifier quoting, string escaping and parameter placeholders for MySQL, PostgreSQL, SQL Server, SQLite and Oracle.
SQL WHERE Builder assembles a WHERE clause from a list of column-operator-value conditions and renders it with the quoting rules of your database engine — backticks for MySQL, double quotes for PostgreSQL, SQLite and Oracle, square brackets for SQL Server. String literals follow the SQL standard, where an embedded apostrophe is escaped by doubling it, with MySQL's extra backslash escaping applied only for MySQL. It is aimed at developers, analysts and support engineers who write ad-hoc queries and want the syntax right the first time.
Open SQL WHERE Builder on AltFTool — it loads instantly in your browser.
Paste your code or data sample into the workspace.
Pick the format, conversion, or analysis you need.
Copy the polished result straight back into your project.
Identifiers use ` " or [ ] per dialect and escape characters are doubled, so pasted SQL parses first time.
Every clause also comes back with placeholders and a matching parameter array for prepared statements.
Null checks emit IS NULL / IS NOT NULL rather than = NULL, which would evaluate to UNKNOWN and match nothing.
Double it: 'O''Brien' is the standard SQL:2016 way to write O'Brien inside a string literal. MySQL also treats backslash as an escape character unless NO_BACKSLASH_ESCAPES is set, so a backslash must be written as \\ there but stays single in PostgreSQL.
AND binds tighter than OR, so a = 1 OR b = 2 AND c = 3 is read as a = 1 OR (b = 2 AND c = 3). If you meant the OR to apply first you must add parentheses — the builder flags any clause that mixes both operators.
Because SQL uses three-valued logic: comparing anything to NULL yields UNKNOWN, not TRUE, so the row is never returned. Use IS NULL or IS NOT NULL, which is what the builder emits for null checks.
MySQL and SQLite use ?, PostgreSQL uses numbered $1, $2, SQL Server uses named @p1, @p2 and Oracle uses :1, :2. The builder produces the right style for the selected dialect alongside the ordered parameter array.