2013-11-09 Baoxinjian
1. Get the System time statement (Ssxff6 get six digits after the decimal point)
Select ' YYYYMMDD Hh24:mi:ssxff6 '), 'yyyymmdd hh24:mi:ss.ff6' from
2. Turn the character into timestamp
Select to_timestamp ('2011-09-14 12:52:42.123456789'syyyy-mm-dd Hh24:mi:ss.ff' from dual;
3. Timestamp turns into date type
Select cast (To_timestamp ('2011-09-14 12:52:42.123456789'syyyy-mm-dd hh24: Mi:ss.ff' as from dual;
4. Date type turns into timestamp
Select cast as timestamp from dual;
5. The date of two is subtracted by the number of days, and the date of the two timestamp is subtracted from the full month day seconds
SelectSysdate-Sysdate,systimestamp-Systimestamp fromdual;SelectExtract Day fromInter* - * - * - +Extract (Hour fromInter* - * - +Extract (minute fromInter* - +Extract (Second frominter) "Seconds" from( SelectTo_timestamp ('2011-09-14 12:34:23.281000000','YYYY-MM-DD hh24:mi:ss.ff')-To_timestamp ('2011-09-14 12:34:22.984000000','YYYY-MM-DD hh24:mi:ss.ff') Inter fromdual); SelectExtract (second fromTo_timestamp ('2011-09-14 12:34:23.281000000','YYYY-MM-DD hh24:mi:ss.ff'))-Extract (Second fromTo_timestamp ('2011-09-14 12:34:22.984000000','YYYY-MM-DD hh24:mi:ss.ff')) fromDual
Note: So, timestamp to figure out the two date interval of how many seconds, to use a function to convert.
The TO_CHAR function supports date and timestamp, but Trunc does not support timestamp data types.
Plsql_ Basic Series 9_ timestamp timestamp