i have to make query
My table structure is like this
towncodeNo TownName
2023001 M1
2023001 M1
2031025 Z1
2031025 Z1
2031030 Z1
Result should be
Townname Total
M1 1
Z1 2
Kindly help me to make query using SQLServer 05

Jignesh TrivediRank #16 · 50.3K reputationPosted Mar 27, 2012, 12:53 AM EDT
using Group by you can achive this.
Select TownName, COUNT(1) as Total from table
Group by towncodeNo ,TownName
hope this help.
mohammad qasimRank #3,405 · 424 reputationPosted Mar 27, 2012, 3:24 AM EDT
solution