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 |
|
zwheeler
Starting Member
25 Posts |
Posted - 2012-01-06 : 12:43:25
|
| I have the following query and it worksI would like to rewrite this query as an outer joing but i donot know how. I wouild like help in rewriting the query.Basically, i just want to return records that do not exists inF47FirmCommitment but do exists in mf_insured_loan.select distinct fk_fha_number,mf_insured_loan.date_firm_commitmentfrom mf_insured_loan, F47FirmCommitmentwhere (fk_fha_number <> FHACaseNumber)and mf_insured_loan.date_firm_commitment is nullThanks in advance |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2012-01-06 : 12:49:00
|
SELECT l.* FROM mf_insured_loan l LEFT JOIN F47FirmCommitment r ON l.key = r.keyON fk_fha_number = FHACaseNumber WHERE r.Key IS NULL -- this needs to be the key in the right (r.) table(not sure which column is in which table...always label all your columns for future references and self documentation)What are the join keys between the 2 tables...you don't show it in your query...which BTW really doesn't work correctlyOh...okBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/ |
 |
|
|
|
|
|