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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:32:31+00:00 2026-06-08T13:32:31+00:00

some help here please with (advanced) mysql. Example illustrates the issue much better. So..

  • 0

some help here please with (advanced) mysql. Example illustrates the issue much better. So..

I have a predefined value pair table PARTNERS with partner1 and partner2 columns. And then there is another table PROJECTS which has partner1 and partner2 columns.

So, I want to select all PROJECTS where columns partner1 and partner2 are within the actual partners table described above.

Obviously, I cannot simply indicate “where partner1=… and/or partner2=…” because there would be no check of whether those two are partners (as defined in the PARTNERS table). (Just in case: there are projects with partner1 and partner2 not in the partner relationships.)

I don’t think that kind of query is possible at all since it has the condition stored in the result. But would be happy if one can prove otherwise.
Thanks

  • 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-08T13:32:34+00:00Added an answer on June 8, 2026 at 1:32 pm

    It sounds like you need a query that will give you rows from PROJECTS where partner 1 and partner 2 are both the same as they are in any row in PARTNERS. So do an inner join:

    SELECT * FROM projects
    INNER JOIN partners
        ON projects.partner1 = partners.partner1
        AND projects.partner2 = partners.partner2
    

    If you’re up for restructuring your tables, it might make more sense to assign a unique ID to every row in PARTNERS, and use that ID in the PROJECTS table. That way instead of storing two columns of redundant data, you just have one column indicating which pair of students is on the project.

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

Sidebar

Related Questions

I need some advanced CSS help here. I have a login button and a
Having some issue with Threadpooling here that I need some help with please. I
I seem to have hit a wall here and would appreciate some help from
iPhone/objC I'm really stuck here and I could use some help, please. Let me
i need some help here. I will like to transfer an Jpg or PNG
Well i need some help here i don't know how to solve this problem.
hope to get some help here because this is something that really makes me
I could really use some help here. I just created a new bare repo
I could really do with some help here. I've spent the past couple of
I'm new here. I thought I could ask for some help here on my

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.