Jump to content

Query Help...Please


Recommended Posts

Hi..

 

I am having difficulty in joining my tables together to get the relevant information. Basically I have 5 tables:

 

Skill_Tbl:

--------

Skill_ID(Int 11)

Skill_Name

 

Person_tbl:

-----------

Person_ID(Int 11)

Person_Name

 

Learnin_Style:

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

Learning_ID (INT 11)

Learning_Name (VARCHAR)

 

Person_Learning:

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

ID (INT 11-AI)

Person_ID

Learning_ID

 

Skill_Learning:

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

ID (INT 11-AI)

Skill_ID

Learning_ID

 

And basically I want to show the following information via some sort of a query:

 

I want to display all the names of the people and skill and style name where Learning ID is the same.

 

 

Is this possible?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/152829-query-helpplease/
Share on other sites

  • 2 weeks later...

Something like this?

 

SELECT a.*,b.*,c.*,d.*,e.* FROM Person_tbl AS a
LEFT OUTER JOIN Person_Learning AS b ON a.Person_ID = b.ID
LEFT OUTER JOIN Learnin_style AS c ON b.Learning_ID = c.Learning_ID
LEFT OUTER JOIN Skill_Learning AS d ON d.Learning_ID = b.Learning_ID
LEFT OUTER JOIN Skill_Tbl AS e ON e.Skill_ID = d.Skill_ID

 

You can use INNER JOIN if you know there will definitely a matching ID in every table and no NULLs

 

 

Link to comment
https://forums.phpfreaks.com/topic/152829-query-helpplease/#findComment-812531
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.