Jump to content

Join with 2 Primary key fields


steelerman99

Recommended Posts

Hello everyone!

 

Let's say I have the following tables:

 

 

TABLE - SONGS

 

ID - SONG

1 - Back in Black

2 - Evenflow

3 - Voodoo Child

4 - Jump Around

 

ID is primary key

 

TABLE FAVS

 

ID - Person - Song1 - Song2

1 - Jeff - 1 - 3

2 - Steve - 2 - 1

3 - Brett - 3 - 4

 

----------------------------------

 

What would be the SQL join query to show the song name in the FAVS table instead of the id so when the query is executed it looks like this:

 

1 - Jeff - Back in Black - Voodoo Child

2 - Steve - Evenflow - Back in Black

3 - Brett - Voodoo Child - Jump Around

 

 

THANKS!

 

 

Link to comment
https://forums.phpfreaks.com/topic/146641-join-with-2-primary-key-fields/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.