select COUNT(tlast._ident) as "Total" FROM ( SELECT * FROM ( SELECT tlast._ident FROM Prelude_Alert AS top LEFT JOIN Prelude_Alert AS tlast ON (tlast._ident = top._ident and tlast._ident BETWEEN 6481 AND 16239) GROUP BY 1 ORDER BY tlast._ident DESC LIMIT 9758 ) AS taux except SELECT * FROM ( SELECT tlast._ident FROM Prelude_Alert AS top LEFT JOIN Prelude_Alert AS tlast ON (tlast._ident = top._ident and tlast._ident BETWEEN 6481 AND 16239) GROUP BY 1 ORDER BY tlast._ident DESC LIMIT 9758 ) AS taux WHERE taux._ident is null ) AS tlast