SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

anikethu
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.

jackv
Flowing Fount of Yak Knowledge

United Kingdom
2067 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
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.06 seconds. Powered By: Snitz Forums 2000