Tuesday, 28 October 2014

How to calculate time based records in SQL

 Every 4 HOUR

/* Formatted on 10/28/2014 5:42:43 PM (QP5 v5.115.810.9015) */
SELECT   *
  FROM   PO_APPROVED_SUPPLIER_LIST
 WHERE   creation_date > (SYSDATE - INTERVAL '4' HOUR)

Every 5 HOUR




 SELECT   *
  FROM   PO_APPROVED_SUPPLIER_LIST
  WHERE CREATION_DATE > TRUNC(SYSDATE - 5 / 24, 'HH')

1 comment:

  1. Regards
    Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
    LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
    Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, Oracle Manufacturing, BI Publisher, OAF, ADF, SQL, PL/SQL, D2K at sridevikoduru@oracleappstechnical.com | +91 - 9581017828.

    ReplyDelete