SQL SELECT Query Builder
Write a readable query by listing conditions instead of remembering syntax and quoting rules.
Use the tool
Why this tool exists
Enter the table, columns (with optional AS aliases), a join of the form "orders on orders.user_id = users.id", conditions one per line (column operator value, including in, not in, like and is null), group by, order by and a limit. Identifiers are validated and quoted for the dialect and values are escaped as literals; SQL Server uses TOP. The sqlite output was run against a test table to confirm the result.
Values are inlined for readability. In application code use bound parameters instead of building SQL from user input.
No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.
How to use it
- Enter the table and columns.
- Type conditions, one per line.
- Add join, ordering and limit.
- Copy the query and move values into parameters in your code.
Frequently asked questions
Which operators work?
=, !=, <>, >, >=, <, <=, like, ilike, not like, in, not in, is null and is not null.
Does it prevent injection?
Identifiers are validated and values escaped, but real code should still use bound parameters.
Can it do subqueries?
No. For complex SQL write it by hand and use the formatter.
Is my data sent anywhere?
No. Everything is processed in your browser, and the page makes no network requests with your input.