인라인된 FROM 내 서브쿼리는 작동을 하는데
전체로 했을때는 다음과 같은 오류가 나는데
코드 실수로 번거롭게 문의드리기가죄송하네요....
혹시 강의때 사용하신 코드들을 복사해서 사용해 볼 수는 없을까요?
ORA-00907: missing right parenthesis Invalid statement
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
SELECT SUBSTR(reserv_date,1,6) AS BASE_DATE, A.product_name AS ITEM_NAME, SUM(DECODE(A.WEEK,'1',A.sales,0)) AS SUN, SUM(DECODE(A.WEEK,'2',A.sales,0)) AS MON, SUM(DECODE(A.WEEK,'3',A.sales,0)) AS TUE, SUM(DECODE(A.WEEK,'4',A.sales,0)) AS WEN, SUM(DECODE(A.WEEK,'5',A.sales,0)) AS THU, SUM(DECODE(A.WEEK,'6',A.sales,0)) AS FRI, SUM(DECODE(A.WEEK,'7',A.sales,0)) AS SAT FROM ( SELECT A.reserv_date, C.product_name, TO_CHAR(TO_DATE(A.reserv_date,'YYYYMMDD'),'d') AS WEEK, B.sales FROM reservation A, order_info B, item C WHERE A.reserv_no = B.reserv_no AND B.item_id = C.item_id AND B.item_id = 'M0005' AND A.reserv_date BETWEEN '20170101' AND '20171231'; ) A GROUP BY SUBSTR(reserv_date,1,6), A.product_name ORDER BY SUBSTR(reserv_date,1,6); SELECT A.reserv_date, C.product_name, TO_CHAR(TO_DATE(A.reserv_date,'YYYYMMDD'),'d') AS WEEK, B.sales FROM reservation A, order_info B, item C WHERE A.reserv_no = B.reserv_no AND B.item_id = C.item_id AND B.item_id = 'M0005' AND A.reserv_date BETWEEN '20170101' AND '20171231';
미처 못봤네요 감사합니다!