I have two database columns in a mysql database, A and B. In a select query, I want to implement this logic:
Select the rows where A is 'X'. If A is not set in a row, then check and select the row only if column B='Y'.
So one can say that column B is a fallback for column A.
How could I construct a SELECT query with 'X' and 'Y' as inputs for the WHERE clause?