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 |
sureshprpt
Starting Member
33 Posts |
Posted - 2010-07-10 : 02:37:24
|
Dear all,I take the report combination two table. One is Order dtails & another one Additional info for order.Common field for both table is Order No & Order Type.Example are follows. Table 1 Table 2 Sale Order Additional info No Type Value No type Info1001 1l 10000 1001 1l Insp req1002 1l 2000 1002 1l Insp req1003 1l 4000 1004 1l Insp req1004 1l 3000 Current report was order no 1003 1l was not captured in that report . becoz there is no entry for order no 1003.But i want 1003 no also in that report .KIndly help me to download the full details in Table 1 with table 2 info , if applicable.Thanks & RegardsSuresh |
|
jeffw8713
Aged Yak Warrior
819 Posts |
Posted - 2010-07-10 : 16:44:56
|
You need to use an outer join - specifically a LEFT OUTER JOIN instead of a normal inner join:SELECT ... FROM dbo.Table1 t1 LEFT OUTER JOIN dbo.Table2 t2 ON t1.Key = t2.KeyJeff |
|
|
|
|
|