Whoops! That should read:
 
..GROUP BY b.branch_id

-----Original Message-----
From: Ryan Kime 
Sent: Tuesday, December 17, 2002 3:19 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Counting Matching Records


This is untested....

SELECT b.branch_id, COUNT(e.emp_id) AS emp_count
FROM Branches b INNER JOIN Employees e
ON b.branch_id = e.branch_id
ORDER BY b.branch_id


-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, December 17, 2002 2:36 PM
To: CF-Talk
Subject: Counting Matching Records


I've got two tables

A. Branches
B. Employees

I need to loop through the "Branches" table, and count the number of
matching employees from the employees table..

Branch A
   13 employees
Branch B
   14 employees


RecordCount won't work here, will it?  What's the best way to do this?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to