to-timestamp

Optimize TO_TIMESTAMP() query within Oracle

余生颓废 提交于 2020-01-03 06:03:15
问题 every time I execute this query it takes like 2 minutes to execute: select * from CPOB_Monitoring_Dashboard where VOYAGE_STRT_DT >= TO_TIMESTAMP('2014-07-03 00:00:00.000','YYYY-MM-DD HH24:MI:SS.FF') and VOYAGE_STRT_DT <= TO_TIMESTAMP('2018-07-03 00:00:00.000','YYYY-MM-DD HH24:MI:SS.FF') However if I change it to use TO_DATE instead of TO_TIMESTAMP is really fast. Linq is generating the query using TOTIMESTAMP and I've not found yet a way to change that to use TO_DATE , is there any way that I

Oracle SQL to_date & to_timestamp ORA-01858: a non-numeric character was found where a numeric was expected & ORA-01850: hour must be between 0 and 23

烂漫一生 提交于 2019-12-12 02:18:04
问题 I have a small bit of code: Code SELECT to_date(it.DSTAMP, 'DD/MM/YYYY') AS "Date", to_timestamp(it.DSTAMP, 'HH24:MI:SS') AS Time FROM itable it Errors ORA-01858: a non-numeric character was found where a numeric was expected 01858. 00000 - "a non-numeric character was found where a numeric was expected" *Cause: The input data to be converted using a date format model was incorrect. The input data did not contain a number where a number was required by the format model. *Action: Fix the input

Convert text to timestamp in redshift

痞子三分冷 提交于 2019-12-01 03:54:33
I have a text field "presence_changed_at" with text values i.e. '2014/12/17 08:05:28 +0000 . I need to convert this into timestamp. In postgreSQL there is function TO_TIMESTAMP() , however in redshift this does not seem to be supported. I can get the date without time by TO_DATE("presence_changed_at",'YYYY/MM/DD HH24:MI:SS') which produces 2014-12-12 but i can't find any way to get TIMESTAMP format. Thanks in advance for solving this try convert function: convert(timestamp,presence_changed_at) It's surprisingly horrible to get a datetime from a unixtime in redshift without a subselect. However

Convert text to timestamp in redshift

℡╲_俬逩灬. 提交于 2019-11-30 03:26:28
问题 I have a text field "presence_changed_at" with text values i.e. '2014/12/17 08:05:28 +0000 . I need to convert this into timestamp. In postgreSQL there is function TO_TIMESTAMP() , however in redshift this does not seem to be supported. I can get the date without time by TO_DATE("presence_changed_at",'YYYY/MM/DD HH24:MI:SS') which produces 2014-12-12 but i can't find any way to get TIMESTAMP format. Thanks in advance for solving this 回答1: try convert function: convert(timestamp,presence