Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with HAVING clause
Message
De
15/02/2007 16:10:33
Mike Yearwood
Toronto, Ontario, Canada
 
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 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01196229
Message ID:
01196286
Vues:
15
>Hi Gang!
>
>I am throwing together some SQL, and ran into a snag
>
>
>SELECT SUM(quan_pur) AS Sum24TransUPC, prod_upc FROM pse_trans ;
>	GROUP BY prod_upc ;
>	HAVING prod_upc = pse_drug.upc ;
>		AND trans_dt >= (DATETIME() - 86400) INTO CURSOR TwentyFourHoursQuantUPC
>
I see you got answered already, but I'd like to point out something else. DATETIME()-86400 is computing per record. That's slower than you might like. The other thing is datetime() moves forward as the time runs.

I would compute DATETIME() - 86400 to a variable first and then use that variable in the query.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform