Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count function

Status
Not open for further replies.

Niksen

IS-IT--Management
Apr 25, 2002
211
EU
I need to make a SQL String that counts the number of users in certain units. Ex:

I need to know how many users there is in the different departments.

Ex:
Region, Country, City, Department Number of users
Asia China Beijing HR Department xxx

Region, Country, City, Department is different tables in the database, but related to each other (Asia -> China -> Beijing...)

Please help :)

 
if you could show the query to retrieve a particular user along with the other fields, i.e. the query to produce this --

Region Country City, Department Username
Asia China Beijing HR Department Todd

then we can show you how to make a very small change to count the number of users


r937.com | rudy.ca
 
Group by and count(*) are what you need here. For more specificity, then follow rudy's advice above.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top