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 8729143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:46:53+00:00 2026-06-13T08:46:53+00:00

My users answer two different questions, they are added to my answers_table as one

  • 0

My users answer two different questions, they are added to my answers_table as one row each. I’m trying to count how many users have answered my questions which seems simple at first. Count(*) and divide by 2. YES! But: the users can add new questions as they go, so suddenly there might be three questions, all answers/3 becomes an incorrect number of users if there was two questions for a while and then three, for example!

Can anyone figure out a query for doing this? So far I’ve got

SELECT COUNT(DISTINCT date) as totNum FROM login_answers

But it doesn’t take the time in consideration. Meaning i just get the amount of answers in total for that day, not knowing how many questions was available that day.

Here’s my table:

qid is the QuestionID so i guess thats somewhere to start?

id      qid answer  date                deviceID
1502    2   2       2012-10-19 08:42:41 7
1503    1   3       2012-10-19 08:51:53 7
1504    2   2       2012-10-19 08:51:53 7
1505    1   4       2012-10-19 09:05:23 7
1506    2   2       2012-10-19 09:05:23 7
1507    1   4       2012-10-19 09:40:59 7
  • 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-06-13T08:46:54+00:00Added an answer on June 13, 2026 at 8:46 am

    My proposed solution would be to store a session Id or some auto-generated key against the answers to uniquely identify a “session” of 2, 3 or more answers from a single person.

    The query would simply be

    SELECT COUNT(DISTINCT session_id) totNum
    FROM login_answers
    

    With your current schema with no identifiable key, it’s quite hard to answer your question correctly if at all possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a number of questions users answer. An unanswered question will have a
I have the following module, which affects how users arrive at two different content
I'm looking for an answer to a question similar to this one: protect users'
I noticed that many people looking for the answer to same question however they
I have been just learning redis and node.js There are two questions I have
I'm trying to help a friend - they have a pretty big web application
I want to build an android application, this application allow the users to answer
I imagine this has a rather simple answer <% for user in @users %>
I'm trying to calculate all the correct answer a user gets and update it
FOUND THE ANSWER MYSELF, see below... I'd like to have a very simple user

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.