Soldato
- Joined
- 5 Dec 2003
- Posts
- 2,716
- Location
- Glasgow
Hey I can't seem to get my head around this query I'm trying to do.
I have 3 tables like so:
[courses]
courseIDPK
coursename
signUps
[users]
usernamePK
password
signUps
[usercourses]
userCourseIDPK
userName
CourseID
I want a query that will check if users.signUps is less than 2, courses.signUps is less than 15 and there isn't a record in usercourses with the username and courseID provided already.
Then I want to add that record and add 1 to both users.signUps and courses.signUps.
Is this possible?
I have 3 tables like so:
[courses]
courseIDPK
coursename
signUps
[users]
usernamePK
password
signUps
[usercourses]
userCourseIDPK
userName
CourseID
I want a query that will check if users.signUps is less than 2, courses.signUps is less than 15 and there isn't a record in usercourses with the username and courseID provided already.
Then I want to add that record and add 1 to both users.signUps and courses.signUps.
Is this possible?