This question has come up a LOT, and I apologize for asking. I've done some extensive searching on this topic and have some of the fundamentals, but I need a nudge in TSQL to be able to accomplish what I'm trying. https://www.simple-talk.com/sql/t-sql-programming/removing-duplicates-from-a-table-in-sql-server/
has the best write-up I've seen so far, but I'm having trouble trying to sponge over the statement to meld it into our environment.
In a table that has approx 1.9 mil rows, there are MANY duplicates. I've been able to identify duplicate records via the following:
SELECT displayName, ExchangeGuid, Store_Id, firstseen, lastseen, COUNT(*) As RecordCount
GROUP BY displayName,
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC
Now, I need to take this to the next step of actually removing ALL BUT ONE on each of those duplicate returns. Each of the search pages I visited before looks like they're using some sort of temp-table to accomplish this???
Apologies for the confusion, but any point in the right direction would be very appreciated.