Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sum and Count filtered records in an SQL statement
Message
De
26/11/1998 14:17:40
Marcelo Codino
Mystic & Faith - Sistemas -
Buenos Aires, Argentine
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Sum and Count filtered records in an SQL statement
Divers
Thread ID:
00161836
Message ID:
00161836
Vues:
50
I have this SQL statement.The instruction works correctly but it sums and counts all table records.I want to do this but only with filetered records.Is it possible in the same instruction ?

Thanks in advance.

SELECT a.field1, a.field2, a.field3, a.field4 ;
FROM mytable a ;
SUM(a.field3) AS n_imp, ;
COUNT(a.field1) AS n_can ;
WHERE a.field2 = tcperiod ;
AND a.field3 = tcyear ;
ORDER BY a.field1 ;
INTO CURSOR myCursor
Thanks in advance
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform