Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select SQL - 2nd Table with multiple records
Message
De
03/10/1998 10:47:59
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Select SQL - 2nd Table with multiple records
Divers
Thread ID:
00143579
Message ID:
00143579
Vues:
67
I have two tables:

patients: with single record per patient and
referrals: with any number of referral records per patient. Each referall record has the patient id field (MNO - relating to MNO field in patients table) as well as a referral date (refdate) field

I want an Select SQL statement which will list all patients to the left of the join and, on the right of the join, ONLY the latest referral record relating to each the patient - i.e. if the patient has 10 referral records, only the most recent to be included.

Is this possible in SQL? Any ideas Gratefully Received!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform