Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Speeding Up SPT Statement Process
Message
 
 
À
04/02/2009 17:27:02
Steven Dyke
Safran Seats USA
Texas, États-Unis
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 9 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01379289
Message ID:
01379365
Vues:
16
You can remove date is not null part from where.

Another way (SQL Server 2005 and up) would be
select * from (select myTable.*, row_number() over (partition by PartNo order by DatStMpi DESC) as rn 
from myTable where myCondition) myMaxDates where rn=1
see http://forums.asp.net/t/1380333.aspx

>Is there any other way to get the record with the greatest datstmpi value without having to use the middle select statment? I believe this may be what is slowing the process, having to pull 75000 plus records on every loop iteration.
>
>
>( SELECT webprddt6.drawmfai.partno, MAX(webprddt6.drawmfai.datstmpi) AS MaxDate 
FROM webprddt6.drawmfai Where toolinspr = 0 And conformir = 0 And DATE(datstmpin) is Not NULL 
GROUP BY webprddt6.drawmfai.partno)
>
>
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