Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Group By Statement
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Group By Statement
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01612581
Message ID:
01612581
Vues:
67
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform