Query required
-
S.No Districtnames count ---- ------------- ------ 1 Visakhapatnam 90 2 RangaReddy 80 3 Srikakulum 30 4 warangal 20 5 others 250 ----- Total 470 I am getting above output. But I have to show warangal and Srikakulum also in others category My Result shoul be looks like below Pls help me in the Query S.No Districtnames count ---- ------------- ------ 1 Visakhapatnam 90 2 RangaReddy 80 3 others 300 ----- Total 470
-
S.No Districtnames count ---- ------------- ------ 1 Visakhapatnam 90 2 RangaReddy 80 3 Srikakulum 30 4 warangal 20 5 others 250 ----- Total 470 I am getting above output. But I have to show warangal and Srikakulum also in others category My Result shoul be looks like below Pls help me in the Query S.No Districtnames count ---- ------------- ------ 1 Visakhapatnam 90 2 RangaReddy 80 3 others 300 ----- Total 470
This has nothing to Do with ASP.Net. Post it on General Database Forum :-D
Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article
-
S.No Districtnames count ---- ------------- ------ 1 Visakhapatnam 90 2 RangaReddy 80 3 Srikakulum 30 4 warangal 20 5 others 250 ----- Total 470 I am getting above output. But I have to show warangal and Srikakulum also in others category My Result shoul be looks like below Pls help me in the Query S.No Districtnames count ---- ------------- ------ 1 Visakhapatnam 90 2 RangaReddy 80 3 others 300 ----- Total 470
As abhijit Said,Don't Try to Post Such Questions here. Let me try,Only this time for You here.
siddisagar wrote:
show warangal and Srikakulum also in others category
if your requirement is to Show A(Visakhapatnam) and B (RangaReddy) and remaining as C (others),then here is the query. select DN,sum(DC) CNT from ( select case Districtnames when 'Visakhapatnam' then Districtnames when 'RangaReddy' then Districtnames else 'Others' end 'DN', count 'DC' from Districts) as t group by DN
Sundeep Ganiga When the only tool you have is a hammer, everything looks like a nail. Come Forth Yourself to Click "Good Answer" for any expected solution. Let us Support our C Project Programmers who provide solutions here.