SELECT Z.CPF,Z.TOTAL FROM (SELECT CPF,COUNT(*) AS TOTAL FROM NOTAS_FISCAIS WHERE TO_CHAR(DATA_VENDA, 'YYYY')= '2016' GROUP BY CPF)Z WHERE Z.TOTAL > 2000;
SELECT Z.CPF,Z.TOTAL FROM (SELECT CPF,COUNT(*) AS TOTAL FROM NOTAS_FISCAIS WHERE TO_CHAR(DATA_VENDA, 'YYYY')= '2016' GROUP BY CPF)Z WHERE Z.TOTAL > 2000;
Olá,
Excelente. Parabéns pelo código e bons estudos.