SQL to fetch data between 2 dates

Source: Internet
Author: User

      1. SELECT * from table1 where Larq between (to_date (' 2008-9-3 ',' Yyyy-mm-dd ')) and (To_date (' 2008-9-5 ',' yyyy-mm-dd '))
        2.SELECT * from table1 where larq>=to_date (' 2008-9-3 ',' yyyy-mm-dd ') and Larq <=to_ Date (' 2008-9-5 ',' yyyy-mm-dd ')

Select COUNT (1) from T_vehicle T where t.createts between To_date (' 2015-7-7 17:13:00 ', ' yyyy/mm/dd hh24:mi:ss ') and to_date (' 2015-7-7 20:55:00 ', ' yyyy/mm/dd hh24:mi:ss ')

To_date (' 2015-7-7 17:13:00 ', ' yyyy/mm/dd hh24:mi:ss ')

To_char (sysdate, 'yyyy/mm/dd hh24:mi:ss')

To_date is an Oracle text-to-date function that must be used
Similarly, date-to-text uses the TO_CHAR function
To_number function for text to value

SQL to fetch data between 2 dates

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.