I have two tables. The first Holds a list of classes with basically an ClassID and a ClassName. The second Holds a list of classes that a pupil does attend using ClassID and PupilID (PupilID refers to a third table).
Is it possible to return for a given pupil a list of ALL Classes irrespective of attendance yet indicate the classes they do attend using MS SQL query. I have read about SQL CASE and IF and even something about creating and assigning variables in queries but none of the examples indicate more than one table.
something like -
|ClassName | Attended
| 1 | 0
| 2 | 0
| 3 | 1
| 4 | 0