Here I need to check the string which is in the format 'a,c,e'. This situation occurred when user select multiple option from check box and in the query I need to check it with the present column.
Example:
Given string:
'a,c,e'
Need to check the given string each word is present in the column columnA or not:
columnA columnB
-------------------
a 1
b 2
c 3
d 4
e 5
f 6
g 7
h 8
If a,c,e present in the column columnA it should retrieve with the columnB:
Expected Result:
columnA columnB
------------------
a 1
c 3
e 5
My try:
select columnA,columnB from
test where columnA ='a'
or columnA = 'c'
or columnA = 'e'
I don't feel! this is the optimize way to do so. And this is also not good for the dynamic query where the string values become changes concurrently.
where columnA IN ('a', 'c', 'e'); but this will not make it "more optimized".. and I have no idea what "string value .. changes concurrently" is referring to.