testa ai
select alert_date, alert_text
from alert_log where alert_date
between to_date('18-dec-2006', 'dd-mon-') and to_date('19-dec-2006',
'dd-mon-')
- Original Message -
From: Rogerio
To: oracle_br@yahoogrupos.com.br
Sent: Tuesday, December 19, 2006 4:13 PM
Subject: [oracle_br] Data no sql
Boa tarde pessoal,
Gostaria de saber como faço para pegar a data do dia ou um periodo
por exemplo os dois ultimos dias.
Exemplo hoje é dia 19/12/2006 gostaria de fazer um select somente do
periodo de 18/12 a 19/12
select alert_date, substr(alert_text,1, 69)
from alert_log where alert_date = to_date('19-dec-2006', 'dd-mon-
');
Tentei o select acima mas não retornou nada e na tabela tem os dados
necessarios como no exemplo abaixo.
ALERT_DAT SUBSTR
(ALERT_TEXT,1,69)
- --
-
19-DEC-06 Successful open of redo thread
1.
19-DEC-06 MTTR advisory is disabled because FAST_START_MTTR_TARGET is
not set
19-DEC-06 SMON: enabling cache
recovery
19-DEC-06 SMON: enabling tx
recovery
19-DEC-06 Database Characterset is
WE8DEC
19-DEC-06 replication_dependency_tracking turned off (no async
multimaster repl
19-DEC-06 Completed: alter database
open
19-DEC-06 Starting ORACLE instance
(normal)
19-DEC-06 ALTER TABLESPACE PSAPROLL
COALESCE
19-DEC-06 Completed: ALTER TABLESPACE PSAPROLL
COALESCE
19-DEC-06 ALTER TABLESPACE SYSTEM
COALESCE
ALERT_DAT SUBSTR
(ALERT_TEXT,1,69)
- --
-
19-DEC-06 Completed: ALTER TABLESPACE SYSTEM COALESCE
O campo ALERT_DAT foi criado como Date na tabela.
Se alguém tiver alguma dica seria muito util.
Grato
Rogério
[As partes desta mensagem que não continham texto foram removidas]