SQL Language (MOSC)

MOSC Banner

using CASE in SQL Query

edited Jun 9, 2010 1:12AM in SQL Language (MOSC) 7 commentsAnswered
  we have a query, that runs just fine. Here is how the query looks like

select ... column names .....
from ...... table_name A, table_name B
where  COL_A = 1026 AND COL_B='DELETED'
AND
((a.col1_date >= to_date(sysdate-1,'dd-mm-yyyy') and
   a.col2_date < to_date(sysdate, 'dd-mm-yyyy')) OR
(b.col1_date >= to_date(sysdate-1,'dd-mm-yyyy') and
  b.col2_date < to_date(sysdate, 'dd-mm-yyyy')))
 
group by a.col,b.col.....


We run this query every morning and get the desired results but on Monday mornings, we need to replace the "sysdate-1" in the above code with "sysdate-3"

so we came up with this

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center