sStr := ' SELECT SALE_DTE, CUST_NME, ITEM_NBR, SALE_QTY, SALE_PRC, SALE_AMT_TOT '#13+
' FROM MKT0TB015 A, MST0TB002 B '#13+
' WHERE A.CUST_NBR = B. CUST_NBR '#13+
' AND SALE_DTE BETWEEN :StartDate AND :EndDate '#13;
SALE_DATE_DTE 그리고 CUST_NME는 중복데이터가 있으면 처음 한번만 출력해주고싶습니다.. 찾아봐도 이해가 안되네요ㅜㅜ 어떤식으로 해야하나요?
SELECT DECODE(ROW_NUMBER()OVER(PARTITION BY SALE_DTE, CUST_NME ORDER BY 1), 1, SALE_DTE) AS SALE_DTE , DECODE(ROW_NUMBER()OVER(PARTITION BY SALE_DTE, CUST_NME ORDER BY 1), 1, CUST_NME) AS CUST_NME , ITEM_NBR, SALE_QTY, SALE_PRC, SALE_AMT_TOT FROM MKT0TB015 A, MST0TB002 B WHERE A.CUST_NBR = B. CUST_NBR AND SALE_DTE BETWEEN :StartDate AND :EndDate ;