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.
| Author |
Topic |
|
pureclass85
Starting Member
29 Posts |
Posted - 2009-03-08 : 15:26:54
|
| could anyone tell me why when i run the following if there is more than one bird it will display it anywayselect a.common_name, a. family_namefrom bird awhere (select count(*) from expectationwhere a.common_name not in (expectation.bird_name);basicly what i have been working on is to only display a birds name if it dosnt appear in the expectation table. if the expectation table has a name that is in there twice it will display that name... and i cannot stop it any ideas? |
|
|
pureclass85
Starting Member
29 Posts |
Posted - 2009-03-08 : 15:45:39
|
| prob even more basicly i am trying to not display a name if it exists in a diff table. but if it dosnt exist in a coloum of a diff table then display it |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-03-08 : 16:02:56
|
| [code]Select a.common_name,a.family_namefrom birds a left outer join Expectation eon a.common_name = e.birdnameWhere e.birdname is nullUNIONSelect a.common_name,a.family_namefrom birds inner join expectations eon a.common_name = e.birdname[/code] |
 |
|
|
pureclass85
Starting Member
29 Posts |
Posted - 2009-03-08 : 16:27:11
|
| indeed a flowing fount of yak knowledge, thank you sir! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-10 : 03:11:46
|
quote: Originally posted by sodeep
Select a.common_name,a.family_namefrom birds a left outer join Expectation eon a.common_name = e.birdnameWhere e.birdname is nullUNIONSelect a.common_name,a.family_namefrom birds inner join expectations eon a.common_name = e.birdname
isnt this same asSelect distinct a.common_name,a.family_namefrom birds left outer join expectations eon a.common_name = e.birdname |
 |
|
|
|
|
|