Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SPT Syntax
Message
 
 
À
19/07/2012 12:59:43
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01548842
Message ID:
01548856
Vues:
45
>I need help with a sql string. My table has a serial number column which is unique. The second column has a part number which can be duplicatied but not in all cases. The third column is an airplane tail number which is the same for all records in set. I need the top two serial numbers(if only 1 exists then top 1) for every distinct part number filtered by the tail number.
>
>Example:
>S/n P/n T/n
>1 845-1 XYZ
>2 846-1 XYZ
>3 846-1 XYZ
>4 846-1 XYZ
>5 847-1 XYZ

Are you using SQL Server or what is your database? If it's a SQL Server, then several simple solutions are available in SQL 2005 and up using ROW_NUMBER() function or CROSS APPLY.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform