Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Make Select quicker
Message
 
 
À
26/01/2006 09:34:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01090482
Message ID:
01090495
Vues:
13
Beth,

AFAIK Group By is not optimizable, so there is no way. I have this problem myself with statistical queries where I need Group By.

You may try to split it, but it probably would not help.

>Hi All,
>
>does anyone know of a way to make this select statement quicker?
>
>SELECT lnPayRecID AS pay_rec_id,;
>  ldStartDate AS st_dte, ldEndDate AS end_dte,;
>  service_id, cst_frml, cst_coef, ano_frml, ano_coef,;
>  adj_frml, adj_coef, cpi_frml, COUNT(*) AS srv_days,;
>  SUM(IIF(EMPTY(date_calc),0,1)) AS calc_days,;
>  SUM(IIF(EMPTY(date_calc),0.00,NVL(contract_base,0.00))) AS cntr_base ,;
>  SUM(IIF(EMPTY(date_calc),0.00,NVL(contract_anomaly,0.00))) AS cntr_ano,;
>  SUM(IIF(EMPTY(date_calc),0.00,NVL(contract_adjustment,0.00))) AS cntr_adj,;
>  SUM(IIF(EMPTY(date_calc),0.00,NVL(contract_total,0.00))) AS cntr_total,;
>  SUM(IIF(EMPTY(date_appr),0,1)) AS appr_days,;
>  SUM(IIF(EMPTY(date_appr),0.00,NVL(appr_final,0.00))) AS cntr_appr ;
>  FROM cutemp;
>  GROUP BY service_id,cst_frml,cst_coef,ano_frml, ano_coef, adj_frml, ;
>  adj_coef, cpi_frml ;
>  INTO CURSOR new_t
>
>
>Thanks,
>Beth
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