Crosstab to eliminate duplicated records?

martedì 06 marzo 2007 - 09.46

aleplgr Profilo | Junior Member

Hi! I have a table with 3 columns: customer id, date and $ Value in the third column.
In this table I need to eliminate duplicated customer ids keeping the one with the highest $ value, to do this I'm using a crosstab, with customer id in rows and summarizing the Value with the Max criteria.. and then exporting this to an excel file and joining it with the original file to recover the Date column because the crosstab only allows one column.
I think there should be another way to do this, filtering the maximun value and keeping all the columns but can't find it...

Carlik Profilo | Junior Member

I suppose this is wrong forum list. You can try in "Microsoft SQLServer ..." List
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © 2002-2023
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5