Very thanks for your answer, but I have still some problems: on my 3000+ record table this query takes 46 seconds to execute (the type and insertdate fileds are already indexed) I think it's the HAVING clause that slows down everything.
I was trying to understand your query when trying this one
SELECT max( insertdate ) , type
GROUP BY type
and magically it returned the same results as yours but only in 0.1 secs, but I would like to know if these two queries are equivalent or not.
I remeber having already tried something similar but without success, and now I am confused, can you help me understand?