I have created the multiselect List of value , it has 2 values - value 'A' and Value 'B'
1.if user selects only value A from the parameter then my query should fetch data 2.If User selects both A and B then query should display data 3.and if user selected only value B from parameter my query should not display data.
i have written oracle SQL query but it is not working.
Select data
from myquery
where
and ((:parameter)='A' or (:parameter) in ('A','B'))
the above query working for first 2 conditions. for 3rd condition it is not working if user select Value B it should not display data but it is displaying data
Any help is appreciated.
Prepare your query something like this:
I have created a SQL fiddle for this case to understand the issue. I have put all the cases for testing. You can uncomment each case and test. Please check the following URL: sqlfiddle.com/#!4/7d4a06/36