我有一个有两列的表,PARENT_PART 和 CHILD_PART。
如果输入零件,我需要所有链接的详细信息。该零件的所有子零件都需要在结果中。
Parent part Child part
OABCDEFG01 OABCDEFG02
OABCDEFG01 OABCDEFG03
OABCDEFG02 OABCDEFG04
OABCDEFG02 OABCDEFG05
OABCDEFG03 OABCDEFG06
OABCDEFG03 OABCDEFG07
OABCDEFG03 OABCDEFG08
OABCDEFG04 OABCDEFG09
OABCDEFG04 OABCDEFG10
OABCDEFG05 OABCDEFG11
OABCDEFG05 OABCDEFG12
OABCDEFG06 OABCDEFG13
OABCDEFG07 OABCDEFG14
OABCDEFG07 OABCDEFG15
OABCDEFG07 OABCDEFG16
OABCDEFG07 OABCDEFG17
OABCDEFG08 OABCDEFG18
OABCDEFG08 OABCDEFG19
根据上表,如果我给出了 PARENT-PART = 'OABCDEFG02'
结果应如下:
PARENT-PART CHILD-PART
OABCDEFG02 OABCDEFG04
OABCDEFG02 OABCDEFG05
OABCDEFG04 OABCDEFG09
OABCDEFG04 OABCDEFG10
OABCDEFG05 OABCDEFG11
OABCDEFG05 OABCDEFG12
我正在使用 DB2 for z/OS(大型机系统)。