delete
from dictionary_entry de1
where exists(
              select type_id, value
              from dictionary_entry de2
              where de2.type_id = de1.type_id
                and de2.value = de1.value
                and (de1.version < de2.version or (de1.version = de2.version and de1.entry_id < de2.entry_id)));

delete
from dictionary_false_recommendation_entry dfre1
where exists(
              select type_id, value
              from dictionary_false_recommendation_entry dfre2
              where dfre2.type_id = dfre1.type_id
                and dfre2.value = dfre1.value
                and (dfre1.version < dfre2.version or (dfre1.version = dfre2.version and dfre1.entry_id < dfre2.entry_id)));

delete
from dictionary_false_positive_entry dfpe1
where exists(
              select type_id, value
              from dictionary_false_positive_entry dfpe2
              where dfpe2.type_id = dfpe1.type_id
                and dfpe2.value = dfpe1.value
                and (dfpe1.version < dfpe2.version or (dfpe1.version = dfpe2.version and dfpe1.entry_id < dfpe2.entry_id)));
