471,050 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,050 software developers and data experts.

SQL, Count and subqueries

Here is the situation:

I have one table that lists a number of courses available (including
CourseID, CourseName and MaxPositions), with CourseID being auto_increment
and unique

I have another table which has CourseRegistration (Containing CourseID and
CustomerID), with no unique fields. Customer information is stored

Without having a field in the Courses table holding the number of people
currently registered, how would I return a result set which included:

CourseID, CourseName, MaxPositions and the Number of people registered to
take that course.

Preferably this would not use features in MySQL 4.1, but anything is fair
game at this point.

Thank you for all of your help.

Garrett Kajmowicz
Jul 19 '05 #1
0 1896

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by JaNE | last post: by
6 posts views Thread by Daniel Elliott | last post: by
1 post views Thread by Garrett Kajmowicz | last post: by
reply views Thread by debasisdas | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.