Table number 1st is output and table 2 is question.
| Zone Name | Area |
| 1 | 3 |
| 2 | 1 |
| 3 | 2 |
| 4 | 3 |
| 5 | 1 |
| 6 | 1 |
| Zone Name | Area |
| 1 | A1 |
| 1 | A2 |
| 1 | A3 |
| 2 | A4 |
| 3 | A5 |
| 3 | A6 |
| 4 | A7 |
| 5 | A8 |
| 6 | A9 |
| 4 | A10 |
| 4 | A11 |
| Zone Name | Area |
| 1 | 3 |
| 2 | 1 |
| 3 | 2 |
| 4 | 3 |
| 5 | 1 |
| 6 | 1 |
| Zone Name | Area |
| 1 | A1 |
| 1 | A2 |
| 1 | A3 |
| 2 | A4 |
| 3 | A5 |
| 3 | A6 |
| 4 | A7 |
| 5 | A8 |
| 6 | A9 |
| 4 | A10 |
| 4 | A11 |
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
kalu singh raoPosted Apr 18, 2014, 3:17 AM
Pradip PandeyPosted Apr 17, 2014, 11:19 PM
Hope this will help you.
Munesh SharmaPosted Apr 17, 2014, 7:38 AM
Nilesh DhandePosted Apr 17, 2014, 7:17 AM
select COUNT(ZoneName) as Area,ZoneName from Areass
group by ZoneName
Jignesh TrivediPosted Apr 16, 2014, 6:55 AM
hi,
try
Create table #table1
(
ZoneName int,
Area varchar(20)
)
Insert into #table1 values(1,'A1'),
(1,'A2'),
(1,'A3'),
(2,'A4'),
(3,'A5'),
(3,'A6'),
(4,'A7'),
(5,'A8'),
(6,'A9'),
(4,'A10'),
(4,'A11')
select ZoneName, COUNT(1) as area from #table1
group by ZoneName
hope this will help you.