0

I have a table which counts messages sent to a particular department. the important structure is basically

ID
Department
Message
DateSent

I want to be able to retrieve a resultset where that looks like this:
Department
MessageCount

something like a SELECT COUNT(ID) Where Department=XXX but collect each individual department count result and join it with the department name it belongs.

can such a thing be done? If it helps, I have the full department details in a separate table, but they are not explicitly linked (although the Department column do logically match).

any help would be appreciated!

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by SelArom
0

If Your table is in Excel, Either Filter or Pivot table in Data Menu can get you all you desire.
Try it.

0

well I'm using sql server, which is why I posted in this subforum. sorry for not making that more clear... right now I think I might just bind the individual counts by calling selects on each binding row in the web page... not idea but there's only about 2 dozen rows, and this page will not be accessed frequently.

if there is a better solution to get it all in one call, please let me know, thank you!

0

lol okay i is dumb, it's a group by! never was much of an sql guru... thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.