Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I do this?
Message
 
To
25/10/2002 07:23:19
Rex Mahel
Realm Software, Llc
Ohio, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00715341
Message ID:
00715557
Views:
10
>In my web application I have 3 tables, EducationalActivities, EducationProviders, and EducationalActivitiesEducationProvidersXRef. As the names may tell you, the XRef is a cross reference table between the Activities and the Providers. I need to display the information as follows:
>
>
> _____ Provider #1
>
> _____ Provider #2
>
> _____ Provider #3
>
>With the underscores being text boxes to hold the count for each Provider.
>
>How can I do this?

Where is your data? On SQL Server, or a similar DBMS?

If that's the case, you may use (as the CommandText) the following expression:
SELECT prov.ProviderId, count(xref.ProviderId) as Count
FROM EducationProviders prov
LEFT JOIN EducationalActivitiesEducationProvidersXRef xref
ON prov.ProviderId xref.ProviderId
GROUP BY ProviderId
That will return all Providers (even those with Count=0)
If you don't want the zeros, replace the LEFT JOIN with an INNER JOIN

Hope this helps
Jose.
------------------
Jose Marcenaro
Tercer Planeta - Argentina
http://www.tercerplaneta.com
Previous
Reply
Map
View

Click here to load this message in the networking platform