Group by - MS SQL Server -


i have table

status  - count delivrd - 68926 failed  - 6369 exp-sms-tmout   - 101 exp-nw-tmout    - 97 exp-mem-excd    - 17 exp-nw-fail - 109 exp-hdst-busy   - 113 exp-abssubs - 5732 

& want result

delivered - 68926 failed  -   6369 exp - 6169   [total(exp-sms-tmout,exp-nw-tmout,exp-mem-excd,exp-nw-fail,exp-hdst-busy,exp-abssubs)] 

how can using group by. please share query asap.

select    case when status 'exp%' 'exp' else status end , sum([count]) [count] table1 group case when status 'exp%' 'exp' else status end 

sqlfiddle demo


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -