SQL IN list builder
This tool turns a column of IDs, emails or names into a ready-to-paste SQL IN clause. Analysts and developers use it to filter a query by a list copied from a spreadsheet, ticket or log.
- Runs in your browser
- Free, no account needed
- Copy or download the result
Result
Example
O'Brien Smith Garcia Smith Nguyen
last_name IN ('O''Brien', 'Smith', 'Garcia', 'Nguyen') Values: 4 (1 duplicate removed), quoted as strings
How to use the sql in list builder
- Paste your values into the Values box, one per line or separated by commas.
- Set the Column name, or clear it to get only the (...) list.
- Choose Quoting, Split values on, Duplicates and an optional Chunk size.
- Press Run, then Copy result or Download.
How it works
Each value is trimmed and empty values are skipped. In Auto split mode, a list on several lines is split by line, and a single line is split by commas.
Auto quoting leaves values bare only when every value is a plain number. Numbers with leading zeros, such as the ZIP code 02134, are quoted so the zeros are kept.
Single quotes inside values are doubled, so O'Brien becomes 'O''Brien'.
Remove duplicates keeps the first copy of each value and is case sensitive. A Chunk size such as 1000 splits the list into several IN lists joined with OR, because Oracle allows at most 1,000 items in one list.
The column name must be a plain identifier like orders.id or a quoted name. Up to 100,000 values are accepted.
Everything runs in your browser. Your input is not uploaded or stored.
Questions and answers
How many values can a SQL IN list have?
Oracle allows at most 1,000 expressions in one IN list. Other databases allow more, but very long lists can be slow, so a temporary table may work better.
Should numbers be quoted in an IN clause?
Not for numeric columns. For text columns that hold digits, such as ZIP codes, choose Quote every value.
Is this safe from SQL injection?
Quotes are escaped, but in application code you should use parameterized queries instead of building SQL from text.
Is my list uploaded?
No. It runs in your browser, and nothing you paste is sent to a server.