Oracle Acquisition Timing time period

Source: Internet
Author: User
PROCEDURE Sp_auto_hour
Is
V_time VARCHAR2 (10);
V_time1 VARCHAR2 (10);

Begin
Select To_char (sysdate-1/24, ' yyyymmddhh24 ') into the v_time from dual;

Select To_char (sysdate, ' yyyymmddhh24 ') into the v_time1 from dual;

INSERT INTO Test select * from Test1 where to_char (time, ' yyyymmddhh24 ') between V_time and v_time1;
Commit

End

You do not have to consider the 0 point of the problem, has been counted, you can try it, you can manually execute
Ask:
This is my SQL statement according to your written change, you see where is not good to help me change

SELECT * FROM table where time between To_date (To_char (sysdate-1/24, ' yyyymmddhh24 '), ' yyyymmddhh24 ') and to_date (to _char (sysdate, ' yyyymmddhh24 '), ' yyyymmddhh24 ');
Chase Answer:
Grammar should not be wrong, do not change, you perform a check the data on the line

Oracle Acquisition Timing time period

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.