Skip to content
Free developer tool

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
Private: runs on this device

Input

33 characters

Leave empty for just the (...) list
0 for one list; 1000 suits Oracle

Result

last_name IN ('O''Brien', 'Smith', 'Garcia', 'Nguyen')

Values: 4 (1 duplicate removed), quoted as strings

Example

Input
O'Brien
Smith
Garcia
Smith
Nguyen
Result
last_name IN ('O''Brien', 'Smith', 'Garcia', 'Nguyen')

Values: 4 (1 duplicate removed), quoted as strings

How to use the sql in list builder

  1. Paste your values into the Values box, one per line or separated by commas.
  2. Set the Column name, or clear it to get only the (...) list.
  3. Choose Quoting, Split values on, Duplicates and an optional Chunk size.
  4. 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.

All 220 SnowRock tools