SELECT link1.setid , link1.inst_prod_id , link3.inst_prod_id FROM ps_rf_inst_link link1 JOIN ps_rf_inst_link link2 ON link1.rel_inst_prod_id = link2.inst_prod_id AND link2.setid = link1.setid AND link1.prod_rel_type = 'SLLS' AND link1.inst_link_status = 'INS' AND link2.prod_rel_type = 'RLON' AND link2.inst_link_status = 'INS' JOIN ps_rf_inst_link link3 ON link3.setid = link2.setid AND link2.rel_inst_prod_id = link3.rel_inst_prod_id AND link3.prod_rel_type = 'SLLS' AND link3.inst_link_status = 'INS' JOIN PS_RF_INST_PROD inst1 ON inst1.setid = link1.setid AND inst1.inst_prod_id = link1.inst_prod_id JOIN ps_prod_mlpb_item mlpb1 ON mlpb1.setid = inst1.setid AND mlpb1.product_id = inst1.product_id AND mlpb1.offer_type = 'SHR'
|