Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL SELECT (*) with COUNT(*)
Message
From
30/06/2000 13:36:42
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00387199
Message ID:
00387204
Views:
20
>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!
Previous
Reply
Map
View

Click here to load this message in the networking platform