I would be forever in debt to the one person that can help me with this case / issue that I'm having:
There is a table with the following structure:
id(AI)| ColA | ColB | ColC
-----------------------------
1 |1 | lorem | ipsum
2 |1 | dolor | sit
3 |0 | amet | nula
...
I would like to set the columns to search in (ColB or ColC) based on the value in the ColA. For example (pseudo query):
- select * from table if ColA = 1 then ColB like '%some_criteria%' else if ColA = 0 then (ColB like '%some_criteria%' and ColC like '%some_criteria%')
Basically, in the same one query:
- if ColA has value '1' then search only in ColB
- if ColA has value '0' then search in ColB and ColC
Let's say that ColB stores article titles and ColC stores articles descriptions. ColA stores articles types. So, if article type is 1, search only in title else, if article type is 0 then search in title and description.
Thank you in advance for your help!