Richscripts

SQL IN clause generator

Paste a column of values from Excel or a file and get a ready IN (...) list for your WHERE clause.

Private: everything happens in your browser. Nothing you type or choose is uploaded.

Split values by

How to use it

  1. Paste your values.
  2. Choose how they are split and quoted.
  3. Copy the IN clause into your query.

Questions and answers

Are quotes inside values escaped?

Yes. A single quote is doubled, so O'Brien becomes 'O''Brien', which is standard SQL.

When are values left unquoted?

In Auto mode, if every value is a number. Choose Always single to quote numbers too.

Is there a limit on IN lists?

Oracle allows 1,000 values per IN list; SQL Server and PostgreSQL allow far more, but very long lists are slow. For thousands of values, consider a temporary table.

Developer tools