I need to get top 1 record from same customer inserted within one hour. If record is inserted after one hour then don’t need that one.
Please see following table. This is just a sample of 1000s of records. I am using SQL Server 2005.
alt text http://img651.imageshack.us/img651/3990/customershavingmultiple.png
The idea is as follows
SQL Statement