Page 1 of 1

Query 3 tables?

Posted: Sun Dec 28, 2008 8:16 pm
by lair74
Can anyone post an example on how I can connect 2 or 3 tables to display the data?

tableComp
compID
compName
compTypeID
empID

tableCompTypes
compTypeID
types

tableEmps
empID
empName

OR
boardType_tbl
boardTypeID
type

boardMembers_tbl
name
boardTypeID

Data in boardType_tbl
types = Executive Officers
Directors
Liaison
Interim Executive Director
Staff

Data in boardMembers_tbl
name = name 1 boardTypeID =1
name2 1
name3 1
name4 2
name5 3

I need to display the data in groups by boardTypeID to display the members
Right now I got all the board types being display with the member name, I need to group by the board types.
Directors
name1,name2,name3 ect..

Any help will be very appreciated.
Thanks.

Re: Query 3 tables?

Posted: Sun Dec 28, 2008 10:16 pm
by cptnwinky
I'm no good at understanding them but I think this is what joins are all about.

http://www.techonthenet.com/sql/joins.php

Re: Query 3 tables?

Posted: Tue Dec 30, 2008 8:43 pm
by Andrewrun
Check out: http://sqlzoo.net/select_join

That has a lot of tutorials on using join statements.