nishmgopal Posted April 6, 2009 Share Posted April 6, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/152829-query-helpplease/ Share on other sites More sharing options...
mtoynbee Posted April 17, 2009 Share Posted April 17, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/152829-query-helpplease/#findComment-812531 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.