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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:57:11+00:00 2026-06-17T12:57:11+00:00

The problem is that I’m using a table that has more than one reference

  • 0

The problem is that I’m using a table that has more than one reference to another table; basically I’m storing three different values for the original artist of a song, if it is featuring another artist, and if it is a remix or not. Each of these link to the artist table and what I want is to be able to return the artist name (no other data) for each of these columns. I have this so far:

SELECT `songName`, `songTrackNumber`, `artist`.`artistName`,
songFeaturingArtist, songRemixByArtist
FROM `song`
LEFT JOIN artist ON songArtist = artistID

I’m not entirely sure how to convert the other two fields from their numeric ID to the name of the artist. Any pointers would be greatly appreciated.

  • 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-17T12:57:12+00:00Added an answer on June 17, 2026 at 12:57 pm

    Join table Artist on table song three times to get the artistName for all the other columns on table song.

    SELECT  a.songName, 
            a.songTrackNumber, 
            b.artistName AS ArtistName,
            c.artistName AS FeaturingArtist,
            d.artistName AS RemixByArtist
    FROM    song a
            LEFT JOIN artist b ON a.songArtist = b.artistID
            LEFT JOIN artist c ON a.songFeaturingArtist = c.artistID
            LEFT JOIN artist d ON a.songRemixByArtist = d.artistID
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem is that i need two different data sets of one mongodb collection
Here is a problem that has been bothering me a lot about Python, I
The problem that I am having has to do with the need to keep
I have a problem that I would like to solve using Django's ORM. I
I have a problem that I'm dealing with since three days and I have
The problem that i am having is I am using a touch listener for
One problem that I have frequently run into lately is the problem of my
The problem that I am facing is simple (and less abstract than the question
The problem that I'm trying to resolve can be seen here: http://jsfiddle.net/AAyLj/14/ Basically, when
One problem that I have with emacs is that it doesn't seem to handle

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.