Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help to build a Query
Message
 
 
To
25/10/2008 22:58:56
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01357186
Message ID:
01357191
Views:
17
>Thanks for your post but I'm using the code of George instead of the name.

Are you building an SP to return modules the particular person doesn't have (@PersonID)? If so, there are 2 simple ways to return your result:

select Modules.* from Modules LEFT JOJN MOdules_Assign on Modules.Code = Modules_Assign.Code and Modules_Assign.Id = @PersonID where Modules_Assign.Code IS NULL

Or

select Modules.* from Modules INNER JOIN Modules_Assign on ... where Modules_Assign.ID not IN (select ID from Names where ID = @PersonID)

BTW, I was thinking how to create an output for all people with their missing modules and I could not make this query yet in my mind. Too complex.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform