我有查询,我在下表之间有以下关系
select * from PRODGP_STRUCTURE
select * from PRODGP_STR_LINK
select * from PRODUCT_GROUP
select * from PROD_PGRP_LINK
select * from PRODUCT
关系是……
select pstr.PSTR_NAME, PG.PRGP_NAME, PRD.PROD_NAME
from prodgp_structure pstr
JOIN PRODGP_STR_LINK pgstrlnk
ON pgstrlnk.PSTR_ID = pstr.PSTR_ID
JOIN PRODUCT_GROUP pg
ON pgstrlnk.PRGP_CHILD_ID = PG.PRGP_ID
JOIN PROD_PGRP_LINK prdprdgp
ON prdprdgp.PRGP_ID = pg.PRGP_ID
JOIN product prd
ON prdprdgp.PROD_ID = prd.PROD_ID;
我提出了以下查询,
select * from PRODGP_STRUCTURE where pstr_id in
(select pstr_id from PRODGP_STR_LINK where PRGP_CHILD_ID in
(select prgp_id from PRODUCT_GROUP where PRGP_ID in ( select PRGP_ID from PROD_PGRP_LINK where PROD_ID in ( select PROD_ID from product where PROD_ID=2))))
请让 e 知道是否有任何其他方式来编写此查询..!!