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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:31:12+00:00 2026-06-05T09:31:12+00:00

I have two tables which i want to query at the same time. The

  • 0

I have two tables which i want to query at the same time. The tables are uploads and audienceuploadassociation, so here is the thing, i have only 1 topic value called “ESL” in my table, but when i use the SQL below it give me 6 records, it repeats the same data 6 times.

SELECT uploads.*, audienceuploadassociation.*
FROM   uploads
  JOIN audienceuploadassociation
    ON uploads.upload_id = audienceuploadassociation.upload_id
 WHERE uploads.member_id = '1'
   AND uploads.member_school_id='1'
   AND subject = 'ESL'
   AND topic = 'Poetry'
LIMIT  20

Here is the table structure for uploads :

`uploads` (
  `upload_id` int(11) NOT NULL AUTO_INCREMENT,
  `member_id` varchar(255) NOT NULL,
  `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `upload_name` text NOT NULL,
  `upload_title` varchar(255) NOT NULL,
  `upload_type` varchar(100) NOT NULL,
  `subject` varchar(50) NOT NULL,
  `topic` longtext NOT NULL,
  `year` int(100) DEFAULT NULL,
  `keywords` varchar(255) NOT NULL,
  `description` longtext NOT NULL,
  `status` enum('Finished','Work in progress','Blank template') NOT NULL DEFAULT 'Finished',
  `test_name` varchar(255) DEFAULT NULL,
  `firstname` varchar(255) NOT NULL,
  `lastname` varchar(255) NOT NULL,
  `member_display_name` varchar(255) NOT NULL,
  `member_school_id` int(11) NOT NULL DEFAULT '1',
  PRIMARY KEY (`upload_id`)
) 

and for audienceuploadassociation :

`audienceuploadassociation` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `upload_id` bigint(20) NOT NULL,
  `audiencename` varchar(254) NOT NULL,
  PRIMARY KEY (`id`)
) 

Any help will be appreciated, 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-05T09:31:15+00:00Added an answer on June 5, 2026 at 9:31 am

    try this, use GROUP BY:

    SELECT uploads.*, audienceuploadassociation.*
    FROM   uploads
      JOIN audienceuploadassociation
        ON uploads.upload_id = audienceuploadassociation.upload_id
     WHERE uploads.member_id = '1'
       AND uploads.member_school_id='1'
       AND subject = 'ESL'
       AND topic = 'Poetry'
    GROUP BY uploads.upload_id
    LIMIT  20
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've two tables which have following columns: Now I want have a SQL query
I have two tables which I want to join together using a left outer
I have two or more tables which hold values under the same column name.
I want to LEFT JOIN two tables with the same column name. I have
I have several hosts from which i want to do the same query. So
I have two tables which looks something like this Table Queue int ID; string
I have two tables which are used to store details of different types of
I have two tables which have some transactional stuff stored in them. There will
I use Hibernate with Java. I have two tables which are associated with foreign
I have two separate tables on which I use a focus+hover function on each

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.