SQL IN Clause Generator

Turn a list of values into a SQL IN (...) clause, with text values quoted and single quotes escaped. Paste one value per line or separate them with commas.

1 Paste your text and pick the options

2 Your answer

Your answer shows here as you type.

How to use the SQL IN Clause Generator

  1. Paste your values into the box, one per line or separated by commas.
  2. Choose how to split the values and whether to quote them.
  3. Copy the IN (...) clause into your WHERE condition.

Frequently asked questions

What does an SQL IN clause do?

WHERE column IN (a, b, c) keeps rows where the column equals any value in the list. It is shorter than writing column = a OR column = b OR column = c.

When should values be quoted in an IN clause?

Numeric columns take bare numbers such as 1, 2, 3. Text, varchar, char and date columns need single quotes around each value, such as 'apple'.

How do I escape a single quote in SQL?

In standard SQL, write two single quotes in a row. The value O'Brien becomes 'O''Brien'. This tool does that automatically when values are quoted.

Is there a limit on how many values an IN list can hold?

Limits depend on the database and version. Very long lists can be slow, so for thousands of values it is usually better to load them into a temporary table and join against it.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.