I have 2 tables:
CREATE TABLE 'deathrun_records' (
'sid64' STRING,
'mapname' STRING,
'seconds' REAL
);
CREATE TABLE 'clan_members' (
'sid64' STRING,
'nome_clan' STRING,
'prop' STRING
);
The first table saves the users 'time on each map, and the second saves the users' clan.
I need a SELECT
to return the clans with users who have more records (shorter time on a map).
What I've done so far:
SELECT COUNT(*) AS recordes FROM deathrun_records d JOIN clan_members c ON c.sid64 = d.sid64 GROUP BY c.nome_clan ORDER BY recordes
My problem is to create a WHERE CLAUSE
to catch only the player with the shortest time on each map. How to do?