Report Practical - Matrix Report

 Matrix Report :

MATRIX REPORT 1:

SELECT CUSTOMER_ID,ORDER_ID,ORDER_DATE FROM ORDERS;

SELECT ORDER_ID,PRODUCT_ID,NVL(UNIT_PRICE,0)*NVL(QUANTITY,0) AMOUNT FROM ORDER_ITEMS;

SELECT A.CUSTOMER_ID,A.ORDER_DATE,B.PRODUCT_ID,B.AMOUNT FROM (SELECT CUSTOMER_ID,ORDER_ID,ORDER_DATE FROM ORDERS) A, (SELECT ORDER_ID,PRODUCT_ID,NVL(UNIT_PRICE,0)*NVL(QUANTITY,0) AMOUNT FROM ORDER_ITEMS) B WHERE A.ORDER_ID=B.ORDER_ID;

Query 2:

SELECT CUSTOMER_ID,TO_CHAR(ORDER_DATE,'RRRR') YR,NVL(SUM(AMOUNT),0) TOTAL_AMOUNT FROM
(
SELECT A.CUSTOMER_ID,A.ORDER_DATE,B.PRODUCT_ID,B.AMOUNT
FROM
(SELECT CUSTOMER_ID,ORDER_ID,ORDER_DATE FROM ORDERS) A,
(SELECT ORDER_ID,PRODUCT_ID,NVL(UNIT_PRICE,0)*NVL(QUANTITY,0) AMOUNT FROM ORDER_ITEMS) B
WHERE A.ORDER_ID=B.ORDER_ID
)
GROUP BY CUSTOMER_ID,TO_CHAR(ORDER_DATE,'RRRR');

MATRIX REPORT 2:

SELECT ORDER_MODE,TO_CHAR(ORDER_DATE,'RRRR') YY, SUM(ORDER_TOTAL) FROM ORDERS GROUP BY ORDER_MODE,TO_CHAR(ORDER_DATE,'RRRR');



Muhammad Abdullah Al Noor

Muhammad Abdullah Al Noor, An Oracle Apex Consultants and founder of Noors Technology (www.noorstech.com). Core Expertise : Database Administration, Oracle Forms and Reports Development, Oracle Apex Application Designer and Development, Linux Professional etc. Also the owner of TrainerBD Training and OraDemy E-Learning. WhatsApp +8801790721177

Post a Comment

Previous Post Next Post