I have a database table with a field “category” that has many different possibilities (100+). I’m trying to write a query that grabs the rows that have “category” that has one of 60ish category possibilities. Currently the query looks like this:
SELECT * FROM table WHERE category = 1 OR category = 2 OR category = 3 OR ... category = 58 OR category = 59 OR category = 60 ;
This seems enormously inefficient. Is there a better way to do this? Can I somehow store all of the category values I’m looking for in an array, and just compare once? Any help would be much appreciated, thanks!