Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Количество договоров по годам
- SELECT EXTRACT(YEAR FROM C.DATE_OF_CONTRACT) AS YEAR, COUNT(*) AS CONTRACTS
- FROM Contracts C
- GROUP BY EXTRACT(YEAR FROM C.DATE_OF_CONTRACT);
- -- Количество договоров по месяцам текущего года
- SELECT EXTRACT(MONTH FROM C.DATE_OF_CONTRACT) AS MONTH, COUNT(*) AS CONTRACTS
- FROM Contracts C
- WHERE EXTRACT(YEAR FROM C.DATE_OF_CONTRACT) = TO_CHAR(sysdate, 'YYYY')
- GROUP BY EXTRACT(MONTH FROM C.DATE_OF_CONTRACT)
- ORDER BY MONTH ASC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement