← Hashito System Home 日本語 Tools Blog Posters
Input
How to use: paste one spreadsheet column and get it formatted for a SQL IN clause. Deduplication, blank removal and wrapping are optional.
Escaping: a single quote inside a value is doubled, following the SQL rule.
Note: queries executed from an application should use placeholders (bind variables), not string concatenation. This tool is an aid for assembling one-off investigation queries by hand.
Output
More than 1000 items. Oracle Database allows at most 1000 expressions in an inline IN list and raises ORA-01795 beyond that. Consider loading the values into a temporary table, or splitting the list.

How to use it (5 steps)

This replaces the column-select trick people repeat in their editor every time they need an ad hoc query.

  1. Paste the values as a column — Copy one column from a spreadsheet and paste it as is. Besides newlines you can split on commas, tabs or spaces.
  2. Decide how to quote — With auto, numeric values are left bare and everything else is wrapped in single quotes. Choose always quote for a string column. Single quotes inside a value are doubled, which is the SQL escaping rule.
  3. Pick the output shape — Choose an IN clause, a bare comma-separated list, VALUES rows, INSERT statements, or an OR chain. The column and table names are editable below.
  4. Set how many values per line — A long IN clause is hard to review on one line. Set 0 to disable wrapping.
  5. Copy and paste it — Deduplication and blank-line removal are on by default. The item count is shown above the output so you can check it against what you expected.

Frequently asked questions (FAQ)

What happens if a value contains a single quote?

It is handled. Following the SQL rule, a single quote inside a value is doubled, so o'hara becomes 'o''hara'. Note that this tool is an aid for assembling SQL by hand. Queries executed from an application should use placeholders (bind variables); building SQL by concatenating strings is how SQL injection happens.

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

It depends on the database. Oracle Database limits an IN list written inline to 1000 expressions and raises ORA-01795 beyond that. This tool warns once you pass 1000 items. For larger sets, load the values into a temporary table and join, or split the list and combine the parts with OR.

Are the values I paste sent to a server?

No. The conversion happens entirely in your browser, with no network request and no storage. Even so, avoid pasting real production data into a browser on someone else machine or a shared terminal, regardless of how the tool is implemented.

What happens with a column that mixes numbers and strings?

In auto mode each value is checked for being a signed integer or decimal and only those are left unquoted; everything else is quoted. A code with a leading zero such as 007 is not treated as numeric, so it is quoted. If you already know the column is a string type, choosing always quote is safer than relying on detection.

How do I keep duplicates?

Uncheck the deduplicate option, which is on by default. Duplicates in an IN clause do not change the result, but removing them keeps the statement easier to review and helps with the limit on the number of expressions.

Free learning posters for kids →