Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Count

Author  Topic 

bob_carter
Starting Member

3 Posts

Posted - 2007-05-04 : 09:53:28
Hi,

I have one table in that i have two fields(Name,city)My question is using Count how to find total citie's name which are same and in the result i want to display like that,

Result
------
Count City
5 Usa
6 ca


Please somebody help me regarding my problem
Thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-05-04 : 10:00:34
[code]Select Count(Name) as [Count], City
From Table
Group by City[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-04 : 10:06:38
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

bob_carter
Starting Member

3 Posts

Posted - 2007-05-04 : 10:11:03
Thanks

Harsh Athalye,Madhivanan.

Go to Top of Page
   

- Advertisement -