Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3349092
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:37:19+00:00 2026-05-18T01:37:19+00:00

I am having a problem in writing the query for this. I have a

  • 0

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

  1. find out the answers by a user
    • SELECT id FROM answers WHERE answering_userid = “ABC”
  2. 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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:37:20+00:00Added an answer on May 18, 2026 at 1:37 am

    With the help of another user codefly I have got the answer I was looking for.

    select a.id, a.answering_userid
    from answers a
    inner join (
       select answering_userid, question_id, min(date) as mindate
       from answers
       group by question_id
    ) first on a.question_id = first.question_id 
        and a.date = first.mindate
        and a.answering_userid = first.answering_userid
    where a.answering_userid = "ABC"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having problem in my UIscrollView ,this is what I have done: Whenever a
I'm having a really hard time writing this query and getting it to work
I’m having a problem with translating T-SQL query into Nhibernate query – or writing
Within the realm of this problem I have 3 entities: User Position License Then
Here's a real noobish MySQL query problem I'm having. I have a high score
i'm having problem writing to a text file using php. this might sound simple
I'm having a problem writing to a file: FileInputStream fin; try { fin =
I am having a problem with a file i am writing too, basically what
I'm having a problem with getting a Ruby string substitution going. I'm writing a
I'm writing a web app, and I'm having a serious problem with too much

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.