View Single Post
  #1 (permalink)  
Old January 7th, 2011, 08:34 AM
sonnfan sonnfan is offline
Registered User
 
Join Date: Jan 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Or in a Case after where

Hi all,

I'm trying to display values of the last 3 month before this.

So i tried it with a case like:

Code:
...
AND "MONTH" = CASE

WHEN to_char(add_months(trunc(sysdate,'MM'),-1),'MM') = '12' THEN '10' OR '11' OR '12'
WHEN to_char(add_months(trunc(sysdate,'MM'),-1),'MM') = '01' THEN '11'  OR '12' OR '01'
...
END
The Problem is, it just won't work with the "or"s within the case. If I just take "...THEN '10' " it works perfectly, but i need it to be the three values. How can i solve that problem?