Objective
Data query, whether in the Web site or in the system are very common, the following article is to introduce to you through the SQL accurate detection of the day data, the following to learn.
The original Oracle database is defined as a day from 12 o'clock in the morning to the next day before 12 o'clock and cannot be equal to the next day of 12 o'clock in the morning.
For example, to find out the data for the 2014-10-1 day
SQL is
Select To_char (bizdate, ' yyyy-mm-dd HH24:mi:ss '), id from Table_person where bizdate >=to_date (' 2014-10-01 00:00:00 '), ' Yyyy-mm-dd HH24:mi:ss ') and bizdate <to_date (' 2014-10-02 00:00:00 ', ' yyyy-mm-dd HH24:mi:ss ')
Use the Java code to directly use the Calender date class to move the date one day
Java Sample Code
Calendar cal=calendar.getinstance ();
Cal.settime (Model.getrepdate ());
Cal.add (calendar.date, 1);//Add one day
Summary
The above is the entire content of this article, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange