Suppose I have data in my main table:
A
B
C
D
And data in a second table that should attach to the main data in one of two ways (X or Y):
A 1 X
A 2 Y
B 3 X
C 4 Y
The secondary table records will be unique per main data and X/Y.
Then I'd like to make a query that shows all main table data with attached data:
A 1 2
B 3
C 4
D
I feel like this should be easy but it's giving me trouble. I'm currently left joining in two successive queries, but all the conditions I've tried have left things out. I can't find the correct google language for this particular problem.