謎解屋

謎解きにはまったSAHK(サーク)というオッサンのサイト

SELECT TA.a03 as "項目1",
TB.b03 as "項目2",
TC.c03 as "項目3"
from TABLE_A TA
left join TABLE_B TB on TA.a02 = TB.b01
left join TABLE_C TC on TB.b02 = TC.c01
where TA.a01 = 3;

TABLE_A
a01 a02 a03
1 2
2 1
3 3
TABLE_B
b01 b02 b03
1 3
2 1
3 2
TABLE_C
c01 c02 c03
1 1
2 2
3 3