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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:57:58+00:00 2026-06-14T09:57:58+00:00

I have two tables: question question_id | question question_answer answer_id | question_id | choice_id

  • 0

I have two tables:

question
question_id | question

question_answer
answer_id | question_id | choice_id | user_id | explain

I want to get all questions for which particular user haven’t answered yet.

SELECT question, question_id as questionId 
FROM question q 
LEFT JOIN question_answer qa USING(question_id)
WHERE qa.user_id!=$userId

I get in this case zero rows. I tried also

SELECT question, q.question_id as questionId 
FROM question q 
LEFT JOIN question_answer qa ON q.question_id=qa.question_id AND qa.user_id!=$userId

Obviously this returns all records. I stuck here how to make this query.

  • 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-14T09:58:00+00:00Added an answer on June 14, 2026 at 9:58 am

    The part of your LEFT JOIN where you check for a specific user should be reversed, i.e. user_id = $userId instead of user_id <> $userId.

    From the resulting rows you select the ones where user_id IS NULL to find the questions for which $userId has not answered (yet).

    SELECT question, q.question_id as questionId 
    FROM question q 
    LEFT JOIN question_answer qa ON q.question_id=qa.question_id AND qa.user_id=$userId
    WHERE qa.user_id IS NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables: answers{..., question_id} and questions{..., answer_id} . In the models I
I have two tables question and answers. - questions{id,user_id,question,date} - answers {id,q_id,user_id,answer, date} I
i have four tables user-question contains two columns: questionID, userID, the questions that the
I have two tables questions and answered . answered contains the answers for all
I have two tables, questions and answers . answers contains a key *question_id* When
I am having two tables question_bank(ques_id,question,answer,a,b,c,d) random_question_bank(user_id,q1,q2,............,q20) I have filled the user_id from users.
I have two Tables: Table 1: Questions : QuestionId NUMERIC Title TEXT Test Data
I have two tables userdetails and blog question The schema is UserDetails: connection: doctrine
Apologies for the poor question title. I have two tables, jobs and Persons-Jobs. Jobs
I have a question: I have two MSSQL tables, items and states, that are

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.