I have a script shown below, that selects only people with identical last name and address (street only) as well as their casino net worth (theo win). I want to select out of this temp table ONLY the lowest theo win so I can delete them from my report temp table and am stuck.. Keep in mind, its finding the duplicate addresses and last name, i just want to do something like:
delete from #report where (this is where it should be based on select from another temp table from my script below as I would change the script below to a select into #other_table) for an example...
Thanks for your help!
select r.player_id,r.firstname,r.lastname,r.address1a, r.totaltwin
from #report r
group by lastname,address1a
having count(*) > 1
on r.lastname = dr.lastname
and r.address1a = dr.address1a