Jump to content

Selecting one list from 2 tables


gevensen

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/176957-selecting-one-list-from-2-tables/
Share on other sites

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

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.