lashX lashX - 10 months ago 23
SQL Question

What is the best way to select multiple rows by ID in sql?

I need to select multiple records

I use

FROM `table`
WHERE `ID` =5623
OR `ID` =5625
OR `ID` =5628
OR `ID` =5621

this query run 4 times in every second whit php

is there a better and faster way for this ?

FROM `table`
where ID in (5263, 5625, 5628, 5621) 

is probably better, but not faster.