View Single Post
  #2 (permalink)  
Old February 28th, 2011, 04:13 AM
arbab arbab is offline
Authorized User
Points: 350, Level: 6
Points: 350, Level: 6 Points: 350, Level: 6 Points: 350, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2008
Location: , , Pakistan.
Posts: 54
Thanks: 8
Thanked 1 Time in 1 Post
Default It might help

*-*-* AND/OR *-*-*

The AND operator displays a record if both the first condition and the second condition is true.
p q p AND q
T T T
T F F
F T F
F F F
The OR operator displays a record if either the first condition or the second condition is true.
p q p OR q
T T T
T F T
F T T
F F F
SELECT CUST
FROM tblcust
WHERE cust > 6110148910985
OR (cust < 8 AND cust > 6)
*-*-*-*
try using brackets:

WHEN to_char(add_months(trunc(sysdate,'MM'),-1),'MM') = ('12' THEN '10') OR ('11' OR '12')
__________________
How to do programming?