Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select field based on max(other field) ?
Message
 
À
20/04/2005 13:47:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01006645
Message ID:
01006650
Vues:
29
This message has been marked as a message which has helped to the initial question of the thread.
>How can I build a single record parent-child view with all the child values coming from the same record? The child record should supply date, amount and otherfield values, but all of them from the record with max(date). Using max(amount) and max(otherfield) gives values that aren't what I need. For this example, I need 6/1/2004, $90.00, Abacus.
>
>Date        Amount   Otherfield
>01/10/2004  $115.00  Zephyr
>06/01/2004  $90.00   Abacus
>
SELECT * FROM Table WHERE Date = (SELECT MAX(Date) FROM Table) INTO ....

Does this what you want?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform