I have something like this:
SELECT cars.brand, cars.id FROM cars WHERE cars.brand =4 LIMIT 1;SELECT cars.brand, cars.id FROM cars WHERE cars.brand =24 LIMIT 1;SELECT cars.brand, cars.id FROM cars WHERE cars.brand =29 LIMIT 1;
If will be more queries it will be very long. How do this in the other way, in one line? But important is for me speed. cars.brand = X AND LIMIT X is a variable so it maybe changes.
Anonymous User
06-Nov-2014You are worried about having to send so many queries one by one, so that would take a lot of time. You can make this one query instead: