Hello.

There is a table:

CREATE TABLE IF NOT EXISTS 'Players' (map TEXT, name TEXT DEFAULT 'None', time TEXT DEFAULT 'None', runtime float NOT NULL DEFAULT 999999.0, id TEXT DEFAULT '0000'); 

So. I need to take the number of the map and with each name from this parameter make a request:

 SELECT id FROM 'Players' WHERE map ='%s' AND runtime < 9999 ORDER BY runtime LIMIT 0, 10 

I can do it programmatically. But then I get a lot of requests. Can this be done in one request?

If I make a request:

 SELECT id FROM 'Players' WHERE map =(SELECT map FROM 'Players' GROUP BY map) AND runtime < 9999 ORDER BY runtime LIMIT 0, 10 

Then I have the result of only one line map

  • Can not be so? - maza51

1 answer 1

instead

 map =(SELECT map FROM 'Players' GROUP BY map) 

write

 map IN (SELECT map FROM 'Players' GROUP BY map) 
  • Sacristy did not notice. All the same 10 results. Probably they did not understand me .. It is necessary that there were 10 results on each 'map' - maza51