I need to use a case type of logic in my query. Database Used: Oracle 11g
The present query looks like:
SELECT name
FROM merchant m
WHERE NOT EXISTS (
SELECT 1
FROM settlement s
WHERE s.sid = m.mid
AND s.rpt_id IN ('111','112','202')
)
There is another column SRID which takes precedence over SID and which can as well be mapped to MID. Now, we need something like IF SRID is null then use SID, else use SRID to map to MID in the WHERE clause.