in the above query i need to write a case statement in where clause for the below conditions pleas do the needful
(comments are locked)
|
|
You cannot use a case statement in the where clause to select which conditional is evaluated. You can however achieve something similar with OR. For instance: Alternatively, you could use dynamic SQL to include just the appropriate condition as you build the query. [Edited for clarity based on helpful comments.] Thank you very much
Aug 10 '12 at 04:12 PM
Mohan
@TimothyAWiseman: "You cannot use a case statement in the where clause." Of course you can! Something like:
Aug 13 '12 at 08:10 AM
eghetto
@eghetto You are right of course. I was not at all clear and I meant you can't use a case statement the way Murali was trying. You can't use it to directly select which conditional statement is evaluated.
Aug 15 '12 at 04:19 PM
TimothyAWiseman
@eghetto I updated it, thank you for helping me clarify.
Aug 15 '12 at 04:20 PM
TimothyAWiseman
(comments are locked)
|

