jasongr
04-19-2007, 02:23 AM
Hi people
I have a table that holds logging information. It contains 3 columns:
Message_ID: The ID of the message (primary key)
Message_Datetime: The datetime when the message was posted
Message: The actual textual message (varchar(255))
I would like to know what is the distribution of the various messages. What I want to perform is a query that will return the number of messages of each type, where the type is defined by the first 10 characters of the message.
What I mean is that all the messages that begin with the same first 10 characters should be grouped together.
I want to have a query that will display for each group, the number of entries. This way I will be able to sort the results and will know what is the most common message group.
Can anyone show me how this can be done?
thanks
I have a table that holds logging information. It contains 3 columns:
Message_ID: The ID of the message (primary key)
Message_Datetime: The datetime when the message was posted
Message: The actual textual message (varchar(255))
I would like to know what is the distribution of the various messages. What I want to perform is a query that will return the number of messages of each type, where the type is defined by the first 10 characters of the message.
What I mean is that all the messages that begin with the same first 10 characters should be grouped together.
I want to have a query that will display for each group, the number of entries. This way I will be able to sort the results and will know what is the most common message group.
Can anyone show me how this can be done?
thanks