Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 logical operators

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-04-01 : 08:05:44
writes "This will include hometowns of players playing for the Dodgers or Giants.
How do I exclude those playing from the Yankees?

EX: If hometowns for A&B are x,y,z
But hometowns for C are x,y
Then only Z should display.


SELECT DISTINCT P.plyrHomeTown
FROM playerTable AS P, TeamTable AS T
WHERE T.TeamName in ('Dodgers','Giants')
AND P.teamId = T.teamId;"

mr_mist
Grunnio

1870 Posts

Posted - 2005-04-01 : 08:07:30
Use AND blah NOT IN ?

-------
Moo. :)
Go to Top of Page
   

- Advertisement -