Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Query Assistance Request - sysdate syntax

zooba72Aug 27 2023

Hello SQL Gurus, I’m struggling to create a query that shows the ‘summary_status’ from today, yesterday, two days ago, and three days ago. The query I currently have simply shows the current ‘summary_status’, but I cannot figure out how to use sysdate to return ‘summary_status’ for prior days in the same query. I played around with using sysdate –1 within the query but I’m receiving errors. Does anyone have any thoughts on how to deal with this ? Underlying database is Oracle. Thank you in advance!

SELECT DISTINCT

   name,

owner,

   Client,

   CASE summary\_status 

     WHEN 0 THEN 'Good'

     WHEN 1 THEN 'Fair'

     ELSE 'Attention'

   END summary\_status,

 support\_group,

       FROM CLIENT
Comments
Post Details
Added on Aug 27 2023
7 comments
140 views