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 |
|
jamie
Aged Yak Warrior
542 Posts |
Posted - 2005-10-07 : 07:49:18
|
| Hi, I am trying to show all establishments that do not exist in tblschemeest table where schemeId is a number.schemeest table consists of schemeID and estID.my current query brings back 0 results..SELECT tblEstablishment.estid, tblEstablishment.dfee, tblEstablishment.name, tblEstablishment.address1, tblEstablishment.address2, tblEstablishment.town, tblEstablishment.county, tblEstablishment.postcode, tblEstablishment.telephone, tblEstablishment.EstTypeFROM tblEstablishment LEFT JOIN tblSchemeEst ON tblEstablishment.estid = tblSchemeEst.EstIDWHERE (((tblSchemeEst.EstID) Is Null)) AND tblSchemeEST.SchemeID=2;how can I get this to work /hope this makes sense.. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-07 : 07:54:37
|
Try thisSelect T.* -- Replace * by columns from tblEstablishment T where not exists(Select * from tblSchemeEst where SchemeID =2 and estid =T.estid )MadhivananFailing to plan is Planning to fail |
 |
|
|
jamie
Aged Yak Warrior
542 Posts |
Posted - 2005-10-07 : 08:00:32
|
| genius.thank you. |
 |
|
|
|
|
|