==[[DB2 グループ化したテーブルを結合する]]==[[DB2]] | [[Database]] | {{category [[Category:SQL}}]]
OS390 および xOS 版
SELECT * FROM F[[R]]OM TABLE1 T1 INNER INNE[[R]] JOIN TABLE (
SELECT
FIELD1F[[IE]]LD1, FIELD2F[[IE]]LD2 FROM F[[R]]OM TABLE2 WHERE WHE[[R]]E FESGK03 = 'FOO' AND FESGK04 = 'BARBA[[R]]' GROUP BY FIELD1F[[IE]]LD1, FIELD2F[[IE]]LD2 ) T2(FIELD1F[[IE]]LD1, FIELD2F[[IE]]LD2) ON T1.FIELD1 F[[IE]]LD1 = T2.FIELD1F[[IE]]LD1 AND T2.FIELD1 F[[IE]]LD1 = T2.FIELD2F[[IE]]LD2