Hi,
I'm working on a simple module and have hit a brick wall with what I presume is a simple db query. Ye I just can't figure it out.
Lets say you have a page that lists a dynamic checkbox list of languages and you want to filter a list of students by the checkboxes selected.
For example, I want to create an SQL query that retreives a list of the names of students who speak English AND French ONLY. I dont want a query that returns English or French.
I would really appreciate any help with this. There has to be some folks out there that can see this straight way.
Cheers,
Colin
----------------------------------------------------------------------------
Here's a simple table structure example:
Table: Students - StudentId (PrimaryKey)
StudentId |
StudentName |
1 |
John |
2 |
Mary |
3 |
Sean |
Table: Languages - LanguageId(PrimayKey)
LanguageId |
LanguageName |
1 |
English |
2 |
French |
3 |
German |
Table: StudentLanguage - StudentId, LangugeId (Composite PrimaryKey)
StudentId |
LangugeId
|
1 |
1 |
1 |
2 |
2 |
3 |
3 |
1 |
3 |
2 |