I had SQL query that was taking 9 hours for execution. See below:
Select Field1, Field2
From A
Where Field3 IN (45 unique values here)
Whe
First, make sure you have an index on your "Field3" in your table "A", and if possible include "Field1", "Field2" (covering index). You don't say which database you are running so it is hard to be precise in giving any better advice.
If that still doesn't speed it up, try creating a temp table, then inserting all the "IN" values and then "INNER JOIN" or "WHERE EXISTS" that temp table to your table "A".