You are here: Re: OUTER JOIN not working? « MsSQL Server « IT news, forums, messages
Re: OUTER JOIN not working?

Posted by Hugo Kornelis on 07/07/06 21:21

On 7 Jul 2006 11:04:59 -0700, kamin@yankeegroup.com wrote:

>For the output, for each row in tyg_aging_service_matrix, I want to
>return all the records for tyg_aging_due_dates
>
>So in my example, there should be 10 rows returned. Their will be 8
>created_date fields that are null when it's done. This is what i'm
>trying to do.

Hi Kamin,

I don't know why you expect 10 rows, since the sample data for
tyg_aging_due_dates has jjust 6 rows. Maybe you meant to add four more?

Anmyway, I tried the query yoou had in your first post, and I got an
error because you attempt to order by a non-existing column named PS.
After removing the ORDER BY clause, I got six rows. Two with a valid
date in created_date; the remaining four had NULLS:

created_date object_type due_date
----------------------- --------------- -----------------------
NULL yg_report 2006-07-10 00:00:00
2006-07-01 00:00:00.000 yg_report 2006-08-14 00:00:00
NULL yg_report 2006-09-11 00:00:00
NULL yg_decisionnote 2006-07-24 00:00:00
NULL yg_decisionnote 2006-08-28 00:00:00
2006-07-01 00:00:00.000 yg_decisionnote 2006-09-25 00:00:00



--
Hugo Kornelis, SQL Server MVP

 

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

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