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 |
|
skillile
Posting Yak Master
208 Posts |
Posted - 2001-12-28 : 08:57:26
|
| here is my join:select a.closeid, a.ordid, a.cldate, a.cldateend, b.label as closer, c.label as preparedby, d.label as location, e.propadd, e.metfileidfrom tblorder_close ainner join tblresource b on a.resid=b.residinner join tblresource c on a.prepid=c.residinner join tbllocation d on a.locid=d.locidinner join tblorder e on a.ordid=e.ordid-----on the second tblresource (join c) I join the prepared idto the resource (person) in tblresource. It is not a requiredfield and I want to show the record even with a NULL value in the prepid field.can I do something likeinner join tblresource c on a.prepid=c.resid ***put a case isnull or somethingthanksslow down to move faster... |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2001-12-28 : 09:08:59
|
| HiThe way to do this is with a LEFT JOIN.e.g.left join tblresource c on a.prepid=c.residThis will join where it can, and leave NULLs for the rows that it can't join. Give it a try and you will seeDamian |
 |
|
|
skillile
Posting Yak Master
208 Posts |
Posted - 2001-12-28 : 09:14:54
|
| thanks I feel stupid...owe ya another.slow down to move faster... |
 |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2001-12-28 : 09:19:54
|
Cheers! Damian |
 |
|
|
|
|
|