ADOQuery1.SQL := 'delete Link where id in (select Max(id) from rss group by Link having Count(Link)>1)'; ADOTable1.Open;