SELECT PROD.SETID , AL.CUST_ID , UPN.UPN_TYPE_CD , AL.PRODUCT_ALIAS , AL.LANGUAGE_CD , AL.DESCR FROM PS_PROD_ITEM PROD , PS_ITEM_MFG_UPN_FS UPN , PS_PROD_UOM UOM , PS_INV_ITEM_DEFLT DFLT , PS_ITEM_MFG MFG , PS_PROD_CSTALS_LNG AL WHERE PROD.PRODUCT_USE <> '2' AND PROD.SETID = UPN.SETID AND PROD.SETID = UOM.SETID AND PROD.SETID = DFLT.SETID AND PROD.INV_ITEM_ID = UPN.INV_ITEM_ID AND PROD.PRODUCT_ID = UOM.PRODUCT_ID AND UPN.UNIT_OF_MEASURE = UOM.UNIT_OF_MEASURE AND UPN.UPN_TYPE_CD = DFLT.GTIN_TYPE_CD AND %Join(COMMON_KEYS, ITEM_MFG MFG, ITEM_MFG_UPN_FS UPN) AND PROD.PRODUCT_ID = ( SELECT MIN(PROD2.PRODUCT_ID) FROM PS_PROD_ITEM PROD2 , PS_ITEM_MFG_UPN_FS UPN2 , PS_PROD_UOM UOM2 WHERE PROD2.SETID = PROD.SETID AND PROD2.SETID = UPN2.SETID AND UOM2.SETID = PROD2.SETID AND UOM2.PRODUCT_ID = PROD2.PRODUCT_ID AND UOM2.PRODUCT_ID = PROD.PRODUCT_ID AND UOM2.UNIT_OF_MEASURE = UOM.UNIT_OF_MEASURE AND UPN2.UNIT_OF_MEASURE = UPN.UNIT_OF_MEASURE AND UPN2.UPN_ID = UPN.UPN_ID) AND PROD.EFF_STATUS = 'A' AND AL.SETID = PROD.SETID AND AL.PRODUCT_ID = PROD.PRODUCT_ID
|