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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:25:15+00:00 2026-05-24T08:25:15+00:00

I have been struggling with this issue for 3 hours. I know I can

  • 0

I have been struggling with this issue for 3 hours. I know I can work around things by putting the data in two different tables but it defeats the object as the data is intrinsically linked and I know the answer will be simple but have tried all ways to get it to work following numerous links/examples but find it very difficult to understand how the example relates to my issue.

This is not the actual SQL but will illustrate exactly what I am trying to do It is a mySQL database.

playerName = Johan Djourou
nationality = Côte d'Ivoire
playsFor = Switzerland

tbl_Soccer_Player
playerID,
playerName,
nationalityID,
playsForID,
CONSTRAINT fk1 FOREIGN KEY (nationalityID) REFERENCES tbl_nationality(notionalityID),
CONSTRAINT fk2 FOREIGN KEY (playsForID) references tbl_nationality(notionalityID)

tbl_nationality
nationalityID
nationality // french, spanish, belgian
country // france, spain, belgium

SELECT playerName, nationality, country FROM tbl_Soccer_Player
JOIN tbl_nationality ON tbl_Soccer_Player.nationalityID = tbl_nationality.nationalityID

… now how do I join the county when they are from the same table???

Many Thanks in Advance,
Mark

PS. I used to solve this sort of thing by using the Microsoft Access GUI query builder to put together query’s but work on Linux Ubuntu now. I will look for a linux based app to do this but does anybody know a good one to use?

  • 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-05-24T08:25:16+00:00Added an answer on May 24, 2026 at 8:25 am

    You make another join with the same table, and use aliases to tell them apart:

    SELECT playerName, n.nationality, p.country
    FROM tbl_Soccer_Player
    JOIN tbl_nationality as n ON tbl_Soccer_Player.nationalityID = n.nationalityID
    JOIN tbl_nationality as p ON tbl_Soccer_Player.playsForID = p.nationalityID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been struggling with this issue for a few hours. I have a table
I have been struggling with this NHibernate issue for hours. I extensively researched on
I have been struggling with this issue for about 10 hours straight. I really
I have been struggling with this issue for a few hours now without understanding
I've been struggling with this issue for a while now. I have OpenCart 1.5.2.1
I've been struggling with this issue for a while now. Maybe you can help.
I've been struggling with this for hours now, and granted I have issues with
I have been struggling with this issue for one week, and still far away
I have been exploring this issue for the first time and I am struggling
I have been struggling with this issue for some days now and I really

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.