Many to Many Table
Posted on 2005-04-18
Evening Guys.. I know i should be able to do this, but i am getting in a muddle a bit..
I have 2 tables... One to display Councillors the other to display the groups that they belong to... I have SQL 2000...
One councillor can belong to many groups, simple ok?? one group can have many councillors... I decided that i should have two tables
I then wrote the following sql statment
SELECT CouncillorGroup.GroupName, CouncillorName.CouncillorName
FROM CouncillorGroup, CouncillorName, MembersGroup
WHERE CouncillorGroup.GroupID = MembersGroup.MGroupID
AND CouncillorName.CouncillorID = MembersGroup.MCouncillorID
to create a many to many table (i am not that used to using sql 2000, from a access backgroud :O/ )
When i parse the statement into the analyzer, its works, or should i say i get no errors, however when i look in the tbl MembersGroup, there is no records displayed... I would say this is right, because nothing is being inserted into that tbl...
SO what should i really be doing?? i.e i guess the statement is near correct, but how do i create the many to many table to show the records??? do i use analyzer?? i guess i am doing something wrong big time..
Thanks in advance