I have 3 tables, A, B and C. They are related as follws: A->C is one-to-many and B->C is one-to-many. The primary key of C is a combination of the foreign keys to A and B. This means that for any combination of A and B there may be 0 or 1 occurrences on C.

I am trying to generate a query that for a particular value of A it will list all occurrences of B and show me whether an occurrence exists or not on C for that combination of A and B.

Example:

Table A contains A1, A2 and A3.
Table B contains B1, B2, B3, B4, B5 & B6.
Table C contains A1B1, A1B3, A1B5

I want the query to show:

A1, B1, true
A1, B2, false
A1, B3, true
A1, B4, false
A1, B5, true
A1, B6, false

Is this possible with a single query? Or do I have to do it in two passes?