SELECT DISTINCT A.BUSINESS_UNIT , A.AUC_ID , A.AUC_ROUND , A.AUC_VERSION , A.LINE_NBR , B.DESCR254_MIXED , (CASE B.AUC_LINE_TYPE WHEN 'G' THEN B.AUC_GROUP_ID ELSE B.INV_ITEM_ID END) FROM PS_AUC_COLLAB_LOG A , PS_AUC_LINE B , PS_AUC_HDR C WHERE (A.RECNAME = 'AUC_LINE_CONST' OR A.RECNAME = 'AUC_LN_CNST_ATT' OR A.RECNAME = 'AUC_LNCNST_ATLS') AND A.BUSINESS_UNIT = C.BUSINESS_UNIT AND A.AUC_ID = C.AUC_ID AND A.AUC_ROUND = C.AUC_ROUND AND A.AUC_VERSION = C.AUC_VERSION AND (C.AUC_COLLAB_STATUS = 'A' OR (A.AUC_COLLAB_SEQNUM < C.AUC_COLLAB_SEQNUM AND C.AUC_COLLAB_STATUS = 'C')) AND B.BUSINESS_UNIT = A.BUSINESS_UNIT AND B.AUC_ID = A.AUC_ID AND B.AUC_ROUND = A.AUC_ROUND AND B.AUC_VERSION = A.AUC_VERSION AND B.LINE_NBR = A.LINE_NBR
|