Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select records with Maximum date group by address
Message
De
03/10/2002 19:09:39
 
 
À
02/10/2002 09:13:49
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00705983
Message ID:
00707614
Vues:
11
Hello,

I have tried your SQL and noticed that it has dropped some of the records that should appear in the results. While the logic makes plenty of sense, the results do not.

select * from pataddress t1 ;
where t1.effective_date = (select max(t2.effective_date) from pataddress t2 ;
where t1.patient_id = t2.patient_id) ;
ORDER BY t1.patient_id

This is my SQL statement. I know I have Patient_ID = 1 in the table twice; but Patient_ID = 1 does not appear in the results.

My PatAddress table has Patient_id's from 1 to 10; but I only have in my results 2, 4, 5, 7, 9, 10.
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform