sqlite - retrieve summed amounts from sql -


what problem following query:

select wbcode||yr, cast(coalesce(cons,0) float), wbcode commodities ccode in (2611,2513,2961) group wbcode||yr 

i want query above return sums every wbcode in given yr (usa1990), example; code above not summing up; retrieving same data as:

select wbcode||yr, cast(coalesce(cons,0) float), wbcode  commodities ccode in (2611) group wbcode||yr  select wbcode||yr, cast(coalesce(cons,0) float), wbcode  commodities ccode in (2513,2961) group wbcode||yr 

how can sum?

thank help.

why || ? group them separately

select wbcode, yr, sum(cast(coalesce(cons,0) float)), wbcode commodities ccode in (2611,2513,2961) group wbcode, yr 

or

select wbcode||yr, sum(cast(coalesce(cons,0) float)), wbcode commodities ccode in (2611,2513,2961) group wbcode, yr 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -