Home > database >  Oracle string type time data for direct comparison
Oracle string type time data for direct comparison

Time:10-26

Database has a field createtime, type of varchar2 (50), the inside of the data format of time,
Such as: 'the 2019-08-05 10:00:00'
Queries can be directly compared with a time string
Select * from TB where createtime & gt; 'the 2019-08-04 08:00:00';
Is to get the correct result set, want to know here is createtiem first and at the back of the '2019-08-04 08:00:00' implicit transformation converts the date type, comparison, or a direct comparison of the location of the string ASCII?

CodePudding user response:

To directly compare the string

CodePudding user response:

Under this scenario, the two values are varchar, affirmation is to directly compare, will not do any form of conversion,

CodePudding user response:

Definition, why not just use the date type to dig a hole yourself,

CodePudding user response:

Two values are varchar, can direct comparison
  • Related