Search code examples
sqlfiltermysql-workbenchwhere-clauseworkbench

How to add constraints with a large amount of objects in SQL query?


I want to get output from a SQL query by adding

WHERE ID IN (
15325335122,
85962128962,
12354789522,
64125335125,
64523578945,
12354784589,
......
........)

This list contains over 9000 rows, I'm wondering if there's an easy way to add them in the where statement since I don't want to copy and paste and add comma one by one. I'm new to SQL, can someone help me? Thanks in advance.


Solution

  • I've figured out the solution by following this instruction

    In excel, select the cell next the first cell next to the first item on the right, then enter =A1&","