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
mohammad qasimPosted Mar 27, 2012, 7:24 AM
solution
Jignesh TrivediPosted Mar 27, 2012, 4:53 AM
using Group by you can achive this.
Select TownName, COUNT(1) as Total from table
Group by towncodeNo ,TownName
hope this help.