Anyone know how to put a CASE or IF statement in a where clause...this didn't work
SELECT NAME FROM CUSTOMERS WHERE
CASE WHEN SYSDATE=SYSDATE THEN
NAME LIKE 'a%'
ELSE
NAME LIKE 'b%'
END
That was just a test to see if the logic works.
I want to change the WHERE clause depending on
a given value. For example if today is a Monday
I want to pull up all the 'Monday' clients
so WHERE Today='Monday' if today is Tuesday
I want WHERE Today='Tuesday'. It may sound
a bit screwy but it's what we need because
we can't save functions, etc. to the database
and need to do everything in in-line SQL
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.