Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting data where field = max(field)
Message
 
 
À
03/11/2011 12:14:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01527898
Message ID:
01527962
Vues:
44
>>>Thanks to all..............Rich
>>
>>select p1.* from prn_Status p1
>>where PrintTime = (select max(PrintTime) from prn_Status p where p.dept = p1.dept)
>
>Thanks Naomi. I appreciate the help.
>
>It turns out that it's MUCH faster to split it into two queries so I'm going to keep the original code.
>
>Again, thanks
>
>.......Rich

Yes, usually the INNER JOIN approach is faster than subquery. There are some other variations of the same theme you can use (say, not exists subquery).
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform