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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Count help
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 04/21/2013 :  00:11:06  Show Profile  Reply with Quote
I have a table with teacher id, & titles. Another table with all the kids and the classes they are enrolled in with the teachers. I need to the count of how many kids does each teacher teach, and include the teachers who don't teach any kids. How do I do it?

Names of table are teacher, and students.

Flowing Fount of Yak Knowledge

United Kingdom
2179 Posts

Posted - 04/21/2013 :  02:17:22  Show Profile  Visit jackv's Homepage  Reply with Quote
You would create a sql statement , using a JOIN and GROUP BY. Could you post the DDL of the tables including the columns- with some sample rows.

Jack Vamvas
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000