I have a table with 3 fields (phonecall,calldate,checked) and I want to remove duplicate rows by the phonecall column value but not the latest one.
In this scenario I want to delete 2 rows from the first of this table.
delete A from TableX A
left join TableX B
on B.CallDate>A.CallDate and B.PhoneCall=A.PhoneCall
where B.PhoneCall is not null