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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:36:13+00:00 2026-06-09T13:36:13+00:00

I have 3 tables from which I’m pulling data Table 1 : assignment_status primary_key

  • 0

I have 3 tables from which I’m pulling data

Table 1 : assignment_status

primary_key   
test_group_id | s_id | date_taken | status
q1            | 123  | 2012-08-13 | completed

Table 2: question_bank

 foreign key    unique key |
 group_id     | q_id       | question
 q1           | 1          | What is your name?
 q1           | 2          | Where were you born?

Table 3: assignment_answers

foreign key  
g_id         | q_id | s_id  | s_answer
q1           | 1    |  123  | Mark Johnson
q1           | 2    |  123  | Florida 

Now I’m attempting to display the answer for it’s corresponding question. The problem I’m facing is that the result set returned is looping multiple times.

For example, if question_bank and assignment_answers have 2 records each the result set has 4 records; if both have 4 records each the result set has 16 records. So the number is getting squared. This makes me sure that I’m pulling it in a wrong manner. Below is my query that I’m using:

SELECT 
    * 
FROM 
    assignment_status s, 
    question_bank b, 
    assignment_answers a
WHERE 
    s.test_group_id = b.group_id = a.g_id = 'q1'

I also tried

SELECT 
    * 
FROM 
    question_bank b, 
    assignment_answers a
WHERE 
    b.group_id = a.g_id
    AND b.group_id = 'q1'
    AND a.g_id = 'q1'

Both queries result in same multiple rows being repeated.

Any suggestions, ideas, thoughts?

Thanks in advance.

  • 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-09T13:36:14+00:00Added an answer on June 9, 2026 at 1:36 pm

    I think you are missing a condition for question_bank b, assignment_answers a

    SELECT 
        * 
    FROM 
        assignment_status s, 
        question_bank b, 
        assignment_answers a
    WHERE 
        s.test_group_id = b.group_id = a.g_id = 'q1' AND b.q_id = a_q.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different tables from which I need to pull data blogs which
I have 2 tables which I want to query from. The first table (lets
I have a table from which I query data to display resultset using stored
I have 3 tables on which i need to select data from using ms-access
I currently have quite a messy query, which joins data from multiple tables involving
I have several tables from which I need to display data. Schools ------- id
I have SMO code which copies tables from one database to another. It runs
I have a csv file from which I have to populate different tables in
I have a dbml to which I have added more then 15 tables from
I have some tables for which I have no reason to ever update from

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.