By Debmedia Technologies LLP · Kolkata, India · Updated
What Is It and When Do You Need It?
Pasting a column of IDs into a query means adding quotes and commas to every line. That is slow and easy to get wrong, especially for hundreds of values.
Paste your list and copy a finished IN clause.
How to Use This Tool
- Paste the values, one per line.
- Choose how to quote them.
- Choose whether to remove duplicates and whether to split into chunks.
- Press Generate and copy the result.
How the Calculation Works
Each non-empty line is trimmed. In automatic mode, a value that looks like a number stays bare and anything else is wrapped in single quotes with inner quotes doubled. The values are joined with commas inside IN ( ... ). With chunking, several IN lists are joined by OR.
Worked Example
The lines apple, banana, O'Brien and 42 give IN ('apple', 'banana', 'O''Brien', 42).
Common Uses
- Ad hoc queries from spreadsheets.
- Data fixes and audits.
- Reports on a list of IDs.
- Cleaning pasted lists.
Tips and Common Mistakes
- Use parameters in application code.
- Check for hidden spaces in pasted values.
- Use chunks for Oracle.
Related Tools
Next, you may need the Markdown table generator, string escape tool, query string parser, JSON to TypeScript.
Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.
Frequently Asked Questions
Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.