Here is my code, I had to split it in three different codes, how can I combine these three into one, all come from same table.
code #1
select SUM(`Line_Total`) as Total,
SUM(`_Revenue`) as Incr
from `table 1`
where `Month`='201909'
code #2
select SUM(`Channel`) as SKG
from `table 1`
where `Division`='Good' and `Month`='201909'
code #3
select SUM(`Channel`) as Direct
from `table 1`
where `Division`='BAD' and `Month`='201909'
Please tell me how I can optimize the code and combine into 1 code only. as they all are in same table, but I dont know how to use multiple where clause with 3 sums
Month
='201909' Do you really think that month number (or name?) have 6 digits? – Akina Nov 5 '19 at 17:21