I need to return the total count of fast lap in different races for a specific player, so I need a where clause with a min statement.
I tried that, but it returns count also when the player doesn’t have the fastest lap:
select
(select count(steamid) from r_monza where steamid='123' and numbestlap=(select MIN(numbestlap) FROM r_monza where steamid='123')) +
(select count(steamid) from r_imola where steamid='123' and numbestlap=(select MIN(numbestlap) FROM r_imola where steamid='123')) totalfastlap
1