I have a query
SELECT sum(cash) from bought_cash WHERE uid=1 AND source NOT IN ('a', 'b')
gives the result as 140
and
SELECT sum(cash) from bought_cash WHERE uid=1 AND source IN ('a', 'b')
gives NULL
and
SELECT sum(cash) from bought_cash WHERE uid=1
gives result as 240
and
SELECT sum(cash) from bought_cash WHERE uid=1 and source is null
gives result as 100
How do I write a query so that the first query gives result as 240 by including the null values.
You can try also next: