i have one table
i would like to classify the apple as below
i try to add code as below, but its not like what I expected
SELECT apple_id, sum(apple_wgt)
,case when apple_colour != 'no colour' then sum(apple_wgt) as 'apple_wgt_no_colour'
,case when apple_colour = 'no colour' then sum(apple_wgt) as 'apple_wgt_colour'
from apples
group by apple_id, apple_wgt
I try this code also, but got error
SELECT apple_id, sum(apple_wgt)
,case when apple_colour != 'no colour' then sum(apple_wgt) end as 'apple_wgt_no_colour'
,case when apple_colour = 'no colour' then sum(apple_wgt) end as 'apple_wgt_colour'
from apples
group by apple_id,
case when apple_colour != 'no colour' then sum(apple_wgt) end,
case when apple_colour = 'no colour' then sum(apple_wgt) end

