jim.davidson Posted September 14, 2012 Share Posted September 14, 2012 I would like to create a list from two tables First Table members table member_id 10 int member_first_name 25 text member_last_name 30 text Second table id_tags table tag_id 10 int tag_number 5 text member_id 10 int from (members table) The list would have the name from the members table and the tag number from the id_tags table How do I write the join? Also some members do not have an id tag but I want them in the list too. Any and all help will be greatly appreciated! Link to comment https://forums.phpfreaks.com/topic/268382-need-help-with-a-join/ Share on other sites More sharing options...
xyph Posted September 14, 2012 Share Posted September 14, 2012 SELECT m.member_first_name, m.member_last_name, t.tag_number FROM members m LEFT JOIN id_tags t USING (member_id) Link to comment https://forums.phpfreaks.com/topic/268382-need-help-with-a-join/#findComment-1377964 Share on other sites More sharing options...
jim.davidson Posted September 14, 2012 Author Share Posted September 14, 2012 Thank you very much! That did it. Link to comment https://forums.phpfreaks.com/topic/268382-need-help-with-a-join/#findComment-1377969 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.