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!