Quick question, I have a table of messages each with a timestamp and a reply_id and a topic_id. Reply_ids can be the same as others, which means those messages are in the same group of replies. When I select a reply_id with the min timestamp, meaning it was the first message of that group, I would also like to know its numbered place within all results of that topic_id, ex. 3rd (3) 4th(4) etc. Anyone know how to do this or have any suggestions? Can this be done in pure sql?
SELECT reply_id,min(timestamp) as min FROM messages
WHERE reply_chunk_id = ?
AND topic_id = ?