Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query Problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01218545
Message ID:
01218547
Vues:
14
>The table SQLGenData has 77000 records in it. The ResNam column is NOT unique.
>The ResAvail table however DOES have a unique ResNam column.
>
>I want to pull all ResAvail records for the SQLGenData records. There should be only
>one result record for each distinct ResNam.
>
>Is it possible to do this in a JOIN?
>
>
>SELECT SysRecord, ResNam, EffDate, AvailDay, EquivDay, EquivWeek, EquivMnth ;
>	FROM ResAvail;
>	WHERE ResNam IN;
>		(SELECT DISTINCT ResNam;
>			FROM SQLGenData);
>	INTO CURSOR Results
>			
>
>
>Thanks

It's possible
SELECT DISTINCT re.SysRecord, re.ResNam, re.EffDate, re.AvailDay, re.EquivDay, re.EquivWeek, EquivMnth ;
  FROM ResAvail re;
  JOIN SQLGenData sq ON sq.ResNam = re.ResNam;
INTO CURSOR results
but I doubt it's any better...

Somebody else may have a better idea
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform