oracle11g - ORA-01843: not a valid month: Oracle error -


i've written below oracle query getting ora-01843: not valid month: oracle error

select distinct info1,info2,timestamp   db_1 info1 = '3.14'  , trunc(timestamp) = to_date('8/19/2015 5:58:51.420000 am','mm/dd/yyyy') 

i need display date in timestamp column getting error. pls help.

you need remove timestamp part in clause , use trunc in select, this:

select distinct info1, info2, trunc(timestamp) timestamp    db_1  info1 = '3.14'     , trunc(timestamp) = to_date('8/19/2015','mm/dd/yyyy'); 

or this:

select distinct info1, info2, trunc(timestamp) timestamp   db_1  info1 = '3.14'     , timestamp = to_timestamp('8/19/2015 5:58:51.420000 am','mm/dd/yyyy hh:mi:ss.ff am'); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -