Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get count plus detail in single SQL?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00663662
Message ID:
00663794
Views:
7
>Try
SELECT Questions.*, COUNT(UserCode) AS VoteCount, ;
>          SUM( IIF(UserCode = lcUserCode, 1, 0)) AS VoteCountCurentUser ;
>	FROM Questions ;
>	LEFT JOIN Votes ;
>	WHERE Questions.SurveyPK=Votes.SurveyPK ;
>	ORDER BY CloseDate DESC ;
>	GROUP BY SurveyPK ;
>	INTO CURSOR TQuery
>
Very nice, Serg. Thanks
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform