I am having a problem in writing the query for this. I have a q&a website where I want to find out the number of first answers by a user – for all the questions answered by a user, which answers were the first for the particular question.
I have two tables –
- questions – id, question
- answers – id, question_id, answering_userid, date
I have broken this into two steps
- find out the answers by a user
- SELECT id FROM answers WHERE answering_userid = “ABC”
- find out if they are the first
- ????? This is where I am having problem. I have figured that it will employ MIN(date).
Can somebody help me in implementing this?
Regards
With the help of another user
codeflyI have got the answer I was looking for.