Select country, price, cost from table1 where user_id = 1 and is_enabled = 1 and country = 'IN' and sender_id = 'TEXT'
The above query will return the records if where conditions are met. Now, I want query to return records even if the conditions are not met but by removing the sender_id from the where condition i.e
Select country, price, cost from table1 where user_id = 1 and is_enabled = 1 and country = 'IN'
Please help!
I tried using CASE When but didn't achieved the result.
1条答案
按热度按时间7gs2gvoe1#
This should help if you need records anyways.
In another use case, you can get the sender_id column if matched by using the below query but it will give you null for all unmatched records.