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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Apr 16, 2014, 2:55 AM EDT
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.
Nilesh Dhande9 reputationPosted Apr 17, 2014, 3:17 AM EDT
select COUNT(ZoneName) as Area,ZoneName from Areass
group by ZoneName
Munesh SharmaRank #174 · 13.9K reputationPosted Apr 17, 2014, 3:38 AM EDT
select Zonename, count(Zonename) from table group by ZonenamePradip PandeyRank #452 · 5.6K reputationPosted Apr 17, 2014, 7:19 PM EDT
Hope this will help you.
kalu singh raoRank #884 · 2.4K reputationPosted Apr 17, 2014, 11:17 PM EDT