Guide 12 hours of data in Excel to Oracle, then turn 12 hours in Oracle to 24 hours data (data type varchar2)

xiaoxiao2021-03-06  31

Excel data format:

2004-11-18 02: 32: 062004-11-18 02: 32: 062004-11-18 02: 32: 062004-10-25 09:43:35

Guide to the Oracle Datasheet (userring3) in the data type of VARCHAR2 type

Field name: RingstartTime

The SQL statement used is:

Update userring3 set ringstarttime = to_char (to_date (RingstartTime, 'YYYY-MM-DD AM HH12: MI: SS'), 'YYYY-MM-DD HH24: MI: SS')

Finally, it will be derived from the userring3 table to the userring table, and the corresponding data type in the userring table is a DATE type.

INSERT INTO Userring SELECT TO_DATE (RingstartTime, 'YYYY-MM-DD HH24: MI: SS'), TO_DATE (RingUpdatetime, 'YYYY-MM-DD HH24: MI: SS'), TO_DATE (PeriodofValidity, 'YYYY-MM-DD HH24: MI: SS ') from userring3

转载请注明原文地址:https://www.9cbs.com/read-72517.html

New Post(0)