TENTE selecionar o
ID
máximo agrupar por db_type
primeiro e depois use-o como subconsulta com not in
. DELETE FROM MyTable
WHERE ID NOT IN
(SELECT ID FROM
(SELECT MAX(ID) AS ID from MyTable GROUP BY DB Type) AS tb1
)
EDITAR:
DELETE FROM MyTable
HAVING MAX(ID) > ID;