gevensen Posted October 8, 2009 Share Posted October 8, 2009 i would like to create a query where sc_members.full_name, sc_contributor_list.fullname show up in one result, or to be more specific one column one is a person one is a church in which the data is stored in different ways but i would like to be able to select from one list without creating a table that combines both names any ideas? SELECT sc_members.full_name, sc_contributor_list.fullname FROM njmetrod_njmetro.sc_contributor_list sc_contributor_list, njmetrod_njmetro.sc_members sc_members GROUP BY sc_members.full_name AND sc_contributor_list.fullname Quote Link to comment https://forums.phpfreaks.com/topic/176957-selecting-one-list-from-2-tables/ Share on other sites More sharing options...
kickstart Posted October 8, 2009 Share Posted October 8, 2009 Hi What you need is a JOIN. Something like:- SELECT tab1Col, tab2Col FROM tab1 INNER JOIN tab2 ON tab1.CommonColumn = tab2.CommonColumn Basically you link the 2 tables together on a common column (ie, your church might have an id column, while your people table might have a column listing the id of their church). If you need more help then just ask, but hopefully you can work the details out from the above. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/176957-selecting-one-list-from-2-tables/#findComment-933032 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.