General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2008 Server
I Have Following Table:
Customer StockGroup Price PriceDate
C01 G01 100.00 1 Jan 2014
C01 G01 200.00 1 Dec 2014
C01 G01 300.00 1 Jun 2014
C02 G55 400.00 1 Nov 2014
C02 G55 500.00 1 Jun 2014
C02 G55 600.00 1 Feb 2014
I want to do a Select Cutomer,StockGroup,Latest(Price) Group by Customer,StockGroup
Result would be:
C01 G01 200.00 (200.00 being dated 1 Dec 214 whcih is the latest Price Date in the Group C01 - G01)
C02 G55 400.00 (400.00 being dated 1 Nov2014 whcih is the latest Price Date in the Group C02 - G55)
i.e. Instead of say Max(Price) , I want the Most Recent Price to appear on the Destination Table
Is there any Sql Select that will do this ?
Tia
Gerard
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only