You are here: Problem with a join due to multiple Nulls « MsSQL Server « IT news, forums, messages
Problem with a join due to multiple Nulls

Posted by chudson007 on 03/29/06 12:40

I want to join 2 tables by a unique ID field, but the ID field also has
multiple NULLS which I do not want to ignore and I fear they will cause
duplication.

Using TableA and TableB below i will demonstrate the problem.

TableA
TableA.ID Field1 Field2
1 Paul 1
Null John 1
2 John 1


TableB
TableB.ID Field3 Field4
1 25 1
Null 32 1
Null 23 1
2 26 1

The Table I want is

TableA.ID TableB.ID Field1 Field2 Field3 Field4
1 1 Paul 1 25 1
2 2 John 1 26 1
Null Null John 1 Null Null
Null Null Null Null 32 1
Null Null Null Null 26 1



I think a select distcinct statement with a full outer join may do what
I want, but I'm not certain so want to check.

Regards,

Ciarán

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация