To_char and to_date Experience Sharing

Source: Internet
Author: User

To_char and to_date Experience Sharing (I) Comparison of the following two methods: to_char (start_time, 'yyyy-mm-dd hh24: mi: ss ') = '2017-06-06 16:18:30 'and start_time = to_date ('2017-06-06 16:18:30', 'yyyy-mm-dd hh24: mi: ss ') the latter is recommended at any time !! (Ii) Simple implementation of converting numbers into English [plain] sys @ ORCL> select to_char (to_date ('20170101', 'J'), 'jj ') as "I love 1314" from dual; I love 1314 ------------------------------------- One Thousand Three Hundred Fourteen (3) A to_date trap. We can use the to_date function to construct any time that we want, in MI and SS, oracle is set to 0 by default, that is, when DD is omitted from the whole day, oracle is set to 1 by default, that is: when MM is omitted, Will oracle be rounded to the year? We will all think in inertia: Yes. Of course, neither! Oracle will not get the whole year, and it will get the whole year to the current month!
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.