Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SPT Syntax
Message
 
 
À
13/11/2008 12:18:48
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 XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01361709
Message ID:
01361714
Vues:
15
>Can you help me with the derived table. What is it exactly do I need to do to fix this?

In your derived table remove OrdNo and other unique fields and group by the rest of the fields and get max of your possible dup field. Then join with the main table based on all fields you grouped on.

In other words,
select myTable.* from myTable inner join (select myGrpField1, myGrpField2, ;
max(Field3) as MaxField from myTable group by 1,2 where myCondition) myDerived ;
ON myTable.myGrpField1 = myDerived.myGrpField1 and ;
myTable.myGrpField2 = myDerived.myGrpField2 ;
and myTable.Field3 = myDerived.MaxField
There are other ways to get the same info.

Let me know if you need help verbatim with your original query or the info above is enough.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform