yaaay
10-09-2007, 05:00 AM
I have the id's (primary key) of some 300 rows of a given table. I would like to construct the fastest query that simply selects from that table the rows corresponding to those id's.
I was thinking "SELECT * FROM table WHERE id='25' OR id='120000' OR id='65' OR ..." but I'm pretty sure that's not the best solution. I know almost any idea will be pretty fast being id the primary key, but I'm looking for the best you can think of. Thanks for your answers!
I was thinking "SELECT * FROM table WHERE id='25' OR id='120000' OR id='65' OR ..." but I'm pretty sure that's not the best solution. I know almost any idea will be pretty fast being id the primary key, but I'm looking for the best you can think of. Thanks for your answers!