I've got a couple of years sql experience.. but I've having a real tough time with one aspect of mysql...
Here's a dumbed down explanation:
Have 4 things:
MessageId,TopicId,Label,TimeStamp
Each tuple in the table has a messageid. That is unique. Multiple messages may have the same topicid.
I need a list of the topics. The Label I need is the first message in a topic. I Figure I can get this either:
* in(timestamp) for that topic
or
*where messageid=topicid
Secondly, I need the date of the most recent message in every topic.
I actually have pretty much solved the problem, but my webhost updated MySQL (I think) and the internal indexing appears to have changed.
Does anyone have any ideas on how I can do this?
Does anyone know how to re-arrange the tuples that will be grouped? Order by orders the result AFTER the grouping... I think I need to order the tuples, then group them.....then order the grouped results again... is this possible?
Any help greatly appreciated. Need more info? Let me know!
Here's a dumbed down explanation:
Have 4 things:
MessageId,TopicId,Label,TimeStamp
Each tuple in the table has a messageid. That is unique. Multiple messages may have the same topicid.
I need a list of the topics. The Label I need is the first message in a topic. I Figure I can get this either:
* in(timestamp) for that topic
or
*where messageid=topicid
Secondly, I need the date of the most recent message in every topic.
I actually have pretty much solved the problem, but my webhost updated MySQL (I think) and the internal indexing appears to have changed.
Does anyone have any ideas on how I can do this?
Does anyone know how to re-arrange the tuples that will be grouped? Order by orders the result AFTER the grouping... I think I need to order the tuples, then group them.....then order the grouped results again... is this possible?
Any help greatly appreciated. Need more info? Let me know!