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
 SQL Server Development (2000)
 Dirt Farmer turned Software Farmer

Author  Topic 

Vivaldi
Constraint Violating Yak Guru

298 Posts

Posted - 2001-05-15 : 17:01:45
Well, okay, I am both.

Quick question, tried to search for the answer but I am not really sure how to put the question into search words.

I have 3 tables.

Resident
ID | Name

Discharge
resident.id | releaseid | releasedate

Release
releaseid | code

basically i wanted
select name,releasedate,code from residentinfo ri
left outer join ResidentDischarge rd on ri.residentid = rd.residentid
Inner join Release r on r.releaseid = rd.releaseid


However, I want to return all records in Resident, and if the record is avail in Discharge, retrieve that inner joined with the release.code.

It seems that the sql is intrepreted as it reads, if there is no releaseid in Discharge it excludes the record, regardless of the outer join.

So how do I get the desired results? It has to be simple, I am just a country boy however. So speak slow...
   

- Advertisement -