Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #72.8K
~14.8K People Reached
Favorite Forums

2 Posted Topics

Member Avatar for t3chpr0digy

The Top 5 expression returns 5 rows of data based on your where clause criteria. You have to add the min() aggregate function in the this case in order to limit the records based on school that fit the where clause criteria. For example see the Table Sample, Query Sample …

Member Avatar for Ezzaral
0
88
Member Avatar for Dani

--Query that selects the distinct rows using a subquery and then does the aggregation [CODE]Select Count(ThreadId), Sum(Viewed) as View_Summary From (Select Distinct ThreadId, Viewed From #tableViews) a[/CODE] --OR-- --Query that eliminates the duplicate rows using the union clause and then does the aggregation [CODE]Select Distinct Count(ThreadId), Sum(Viewed) as View_Summary From …

Member Avatar for Perez_Bottoms
0
15K

The End.