SQLPlus Remark

REMARK Command Syntax:

REM[ARK]

REMARK Command Example:

REM COMPUTE uses BREAK ON REPORT to break on end of table
BREAK ON REPORT
COMPUTE SUM OF “CONTRACT 1” “CONTRACT 2” “CONTRACT 3” “TOTAL BY PRODUCT_ID” ON REPORT
REM Each column displays the sums of contracts by product for
REM one of the contracts 1, 2, 3.
SELECT PRODUCT_ID,
SUM(DECODE( CONTRACT_ID, 1, AMOUNT, 0)) “CONTRACT 1”,
SUM(DECODE( CONTRACT_ID, 2, AMOUNT, 0)) “CONTRACT 2”,
SUM(DECODE( CONTRACT_ID, 3, AMOUNT, 0)) “CONTRACT 3”,
SUM(AMOUNT) “TOTAL BY PRODUCT_ID”
FROM CONTRACTS_VIEW
GROUP BY PRODUCT_ID;