| 发表于:2007-11-12 21:19:13 楼主 |
大家看这个语句: select cabprtyp.id cableproductpricetypeid, cabprtyp.pricetype, cable.cableid, cable.owner, cable.anndocno, cable.validfrom, product.typeid, product.model, product.feature, product.frommodfea, product.tomodfea,product.brand, product.division, product.description, product.id productid from wwprt.price_cn price, wwprt.cable_product_join_cn cabprod, wwprt.cableproduct_pricetype_join_cn cabprtyp, wwprt.product_cn product, wwprt.cable_cn cable where price.overridden = 'n' and price.released = 'y' and price.cableid = cabprod.cableid and price.productid = cabprod.productid and cabprod.id = cabprtyp.cableproductid and price.pricetype = cabprtyp.pricetype and price.productid = product.id and price.cableid = cable.cableid and not exists ( select 1 from wwprt.price_cn price_draft, wwprt.cable_cn cable_draft where price.productid = price_draft.productid and price.country = price_draft.country and price.pricetype = price_draft.pricetype and price.distch = price_draft.distch and price_draft.cableid = cable_draft.cableid and cable_draft.status in ('01', '04') ) 子查询中的price是父sql的一个别名,我想知道子查询的作用是什么,好像是同一个表在比较字段,请高人指点。 |
|
|
|
|