Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL command: syntax needed
Message
De
22/03/2004 10:54:02
 
 
À
22/03/2004 10:37:33
Bruno Maddalozzo
Informatica Aziendale
Arsie, Italie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00888526
Message ID:
00888536
Vues:
13
>I need a query to extract the most recent price inserted for a product
>i.e.
>
>
>id_product    year   price
>1             2004   12004
>1             2003   12003
>2             2003   22003
>2             2002   22002
>
>
>so as to obtain
>
>id_product    year   price
>1             2004   12004
>2             2003   22003
>
>
>
>Which is the SQL syntax to perform the Select?
>TIA

SELECT TOP 1 price FROM {table} ORDER BY year DESC
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform