Boneyard Tools

SQL IN Clause Builder

Paste a list of IDs, names or codes, one per line or comma separated, and get a clean SQL IN (...) clause. Strings are quoted and escaped, pure number lists stay unquoted.

How to build a SQL IN clause

  1. Paste your values, one per line or separated by commas.
  2. Optionally set a column name, dedupe, sort or force quoting.
  3. Copy the generated IN (...) clause into your query.

Examples

Names to a quoted IN clause

alice
bob
carol
IN ('alice', 'bob', 'carol')

Numbers stay unquoted

101
102
103
IN (101, 102, 103)

Frequently asked questions

When are values quoted versus left as numbers?

By default the list is auto-detected: if every value is a plain number it stays unquoted, otherwise all values are single-quoted as strings. You can also force either mode.

How are single quotes inside values handled?

They are escaped the SQL-standard way by doubling them, so O'Brien becomes 'O''Brien'. This keeps the clause safe to paste into most databases.

Can it remove duplicates and sort the list?

Yes. Turn on dedupe to drop repeated values keeping the first occurrence, and sort to order them. Number lists sort numerically, text lists sort alphabetically.

Can I add the column name automatically?

Yes. Enter a column such as user_id and the output becomes user_id IN (...), ready to drop into a WHERE clause.

Is my data uploaded anywhere?

No. The clause is built entirely in your browser and nothing is sent to a server, so it is safe for sensitive IDs and identifiers.

Related tools