> SQL server question, I have the following tables > > > project > -------- > projectID > projectName > ... > > projectuser > ---------- > userID > projectID > > > projectpermissions > ----------------- > userID > projectID > permission > > I need to find any user who has a permission entry (projectpermissions > table) for a project (project table) that there are not a member of > (projectuser table). > > Not my DB design, so I know its crap. I just get to fix it :-) >
Nowt wrong with the DB design.... Perfectly normal relational database and makes the query you want pretty easy to create using subqueries. SELECT UserID FROM projectpermissions WHERE projectID = 123 AND UserID NOT IN (Select UserID FROM ProjectUser WHERE projectID = 123) This should do the trick..... Stephen -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
