How to deal with a query SQL statement

Source: Internet
Author: User
For a query of a SQL database table, there is a field create_time, the type is int (10), and the corresponding timestamp is stored. This data table has been stored for more than a year. Now I want to query all records of the create_time field from to every day. How can I write this SQL statement? ------ Solution ----------------------

For a query, the SQL database table has a field create_time, whose type is int (10) and the corresponding timestamp is stored. This data table has been stored for more than a year. Now I want to query all records of the create_time field from to every day. How can I write this SQL statement? ------ Solution ----------------------

SQL query
The database table has a field create_time, whose type is int (10) and stores the corresponding timestamp.
This data table has been stored for more than a year.

Now I want to query all records of the create_time field from to every day. How can I write this SQL statement?
------ Solution ----------------------
Select * from table where FROM_UNIXTIME (create_time, '% H: % I') BETWEEN '14: 00' and '20: 00'
--- [This article from the Internet (http://www.68idc.cn)] --- solution ----------------------
It is not recommended to store unix timestamps in the database. functions are required for your business and the execution efficiency will decrease.

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.