Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL SELECT (*) with COUNT(*)
Message
De
30/06/2000 13:36:42
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00387199
Message ID:
00387204
Vues:
21
>Is there a way to run an SQL SELECT and get ALL the rows of data and still get a COUNT(*)? I have tried this, but it looks like like I'm just getting the last row of data along with the count. TIA, Chuck.

No easy way, afaik. You could join in the count information or use a union to add two tables together.

I would probably do this:
select * from mytable into cursor mycursor
select cnt(*), key from mytable group by mykey into cursor mycounts
select * from mycursor, mycounts where mycursor.key = mycounts.key

You might have to play around with dbf() or selecting into tables instead of cursors, but this should put you on the right track!
--Todd Sherman
-Wake Up! Smell the Coffee!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform