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:
00663795
Views:
8
>>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

You're welcome.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform