overDeveloper
Programmer
I have three tables
tbl_main
id officeID title
1 2 aaaaa
2 2 bbbbb
3 4 ccccc
tbl_offices
id groupID title
1 2 officeA
2 2 officeb
3 1 officec
tbl_group
id groupname
1 groupA
2 groupb
3 groupc
I need a query that will return, for example, all of the records from tbl_main where I am given a group ID. So if I am given a group id of 3 I want all of the records from tbl_main who have an office with a groupID of 3....
How would I go about this?
tbl_main
id officeID title
1 2 aaaaa
2 2 bbbbb
3 4 ccccc
tbl_offices
id groupID title
1 2 officeA
2 2 officeb
3 1 officec
tbl_group
id groupname
1 groupA
2 groupb
3 groupc
I need a query that will return, for example, all of the records from tbl_main where I am given a group ID. So if I am given a group id of 3 I want all of the records from tbl_main who have an office with a groupID of 3....
How would I go about this?