sql - same type of value in a single row using case or decode -


dear friend have written following query, , got result in image.

select         (case when croptype_code < 13 'pedi' else 'paudha' end) pl_rpflag,     nvl(sum(gh_area),0) area     w_cane_survey_2013     unit_code = '03' , gh_vill = '9991' , gh_grow= '1'     group croptype_code; 

query result

row1 , row3 both has paudha area displayed separately. want such values should add. means values of paudha should in single row , pedi values in single row.

select m.pl_rpflag, sum(m.area)  (   select (case when croptype_code < 13 'pedi' else 'paudha' end) pl_rpflag,     nvl(sum(gh_area),0) area   w_cane_survey_2013   unit_code = '03'      , gh_vill = '9991'      , gh_grow= '1' ) m group m.pl_rpflag 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -