can't figure out sql query
Robert Brenstein
rjb at robelko.com
Tue May 2 17:17:00 CDT 2006
I am somehow dense today and can't figure out an SQL query :(
table 'users' has each user identified by 'userid'
table 'students' has references to 'users' in column 'studentid'
table 'teachers' has references to 'users' in column 'teacherid'
Yes, I am using the traditional keys.
I am trying to find a count of users who are neither teachers nor
students, that is to count records in 'users' that have no entries in
tables 'students' and 'teachers', and I am drawing a blank. Note that
'students' and 'teachers' may have multiple entries for a given user
since these tables establish M:M relations between 'users' and
'courses'.
Robert
More information about the Valentina
mailing list