2 lots of info from same table in same row

If I have TableA with id A_ID and TableB with id B_ID and Foreign Key A_ID creating the relationship. TableB had a fields FieldC which could have value x, y or z.

What I want is a query that brings back one row where the IDs match with a column showing the B_ID where FieldC is x and another where FieldC is y:

eg

Table1:
A_ID
1
2
3

Table2:
B_ID, A_ID, Field_C
1, 1, x
2, 1, y
3, 1, z
4, 3, y

Query:
aID, Xistrueid, Yidtrueid
1, 1, 2
3, null, 4

How do i do this? Hope that makes sence!!

cheers

steve


SELECT
    a.A_ID AS aID
  , b.B_ID AS Xistrueid
  , c.B_ID AS Yistrueid
FROM Table1 a
LEFT OUTER JOIN Table2 b
ON a.A_ID = b.A_ID
AND b.FIELD_C = 'x'
LEFT OUTER JOIN Table2 c
ON a.A_ID = c.A_ID
AND c.FIELD_C = 'y'