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 |
|
Deon Smit
Starting Member
47 Posts |
Posted - 2008-11-18 : 04:45:07
|
| Hi all. My 2 tables are as follow. Table ITEMItem | Supp |-------------1 | 222 | 3 | 11Table SUPPLIERSupp | Name--------------11 | ABC22 | DEF33 | ZYXMy Script.Select A.item b.name from ITEM Ajoin SUPPLIER Bon A.SUPP = B.SUPPMy results.Item | NAME |-------------1 | DEF3 | ABCI want it not to loose my second item. It can even display it then as..Item | NAME |-------------1 | DEF2 | 3 | ABCorItem | NAME |-------------1 | DEF2 | NONE3 | ABCPlease Help. |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2008-11-18 : 04:50:30
|
| Select A.item ,ISNULL(b.name,'NONE') from ITEM Aleft join SUPPLIER Bon A.SUPP = B.SUPP |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-11-18 : 04:53:36
|
| or use Coalesce instead of isnullMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-11-18 : 06:20:38
|
| http://sqlblogcasts.com/blogs/madhivanan/archive/2007/10/04/isnull-or-coalesce.aspx |
 |
|
|
Deon Smit
Starting Member
47 Posts |
Posted - 2008-11-18 : 09:52:09
|
| Thanks all. I manage to use a left outer join. Worked like a dream. |
 |
|
|
|
|
|