Algo assim
mês=4 /* abril*/
select * from tabela where
extract (month from data)=&mês
Agradeço desde já a ajuda e desculpa se postei no local errado já que me inscrevi hoje e não conheço bem o forum.
mês=4 /* abril*/
select * from tabela where
extract (month from data)=&mês
-- Cursor com Parâmetro ------------------------------------------------------
DECLARE
CURSOR cur_empregados (p_empno NUMBER)
IS
SELECT *
FROM emp
WHERE empno = p_empno;
v_resultado cur_empregados%ROWTYPE;
BEGIN
OPEN cur_empregados(7499);
FETCH cur_empregados INTO v_resultado;
CLOSE cur_empregados;
dbms_output.put_line('Empregado: ' || v_resultado.ename);
END;
select dtexportacao
from planopagamento
where extract (month from dtexportacao)=&mês
/
SQL> @data
Input truncated to 1 characters
Enter value for mês: 10
old 3: where extract (month from dtexportacao)=&mês
new 3: where extract (month from dtexportacao)=10
DTEXPORTACA
-----------
01-OCT-2007
09-OCT-2007
03-OCT-2005
01-OCT-2007
02-OCT-2007
19-OCT-2005
09-OCT-2007
01-OCT-2007
09-OCT-2007
04-OCT-2007
09-OCT-2007
01-OCT-2007
12 rows selected.
SQL> @data
Input truncated to 1 characters
Enter value for mês: 5
old 3: where extract (month from dtexportacao)=&mês
new 3: where extract (month from dtexportacao)=5
DTEXPORTACA
-----------
21-MAY-2007
17-MAY-2005
17-MAY-2005
17-MAY-2005
09-MAY-2007
09-MAY-2007
6 rows selected.
SQL>
Usuários navegando neste fórum: Nenhum usuário registrado e 6 visitantes