Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: LEFT OUTER ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 3450 of 3717
Post > Topic >>

Re: LEFT OUTER JOIN question

by craig@[EMAIL PROTECTED] (Craig Ringer) May 5, 2008 at 12:40 AM

seiliki wrote:
> Hi!
> 
> I expect the SELECT to return two rows. Would some kind 
> soul explain for me why it gives only one row?

Without having read the post in detail I'll make a guess: Because NULL =
NULL results in NULL, not true, and the outer (or any other) join
condition only accepts rows where the join condition is true.

This is a FAQ. It probably needs to go in the PostgreSQL FAQ.

The usual response is: Rethink your use of NULL values. Null really
means "unknown" and if you're comparing for equality you probably don't
really want NULLs to be present. If you absolutely must perform
comparisons where NULL should be considered equal to NULL use `IS
DISTINCT FROM` ... but as everybody here says, use of that often
suggests design problems in your queries and schema.

--
Craig Ringer


-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 4 Posts in Topic:
LEFT OUTER JOIN question
seiliki@[EMAIL PROTECTED]  2008-05-05 00:28:04 
Re: LEFT OUTER JOIN question
craig@[EMAIL PROTECTED]   2008-05-05 00:40:24 
Re: LEFT OUTER JOIN question
fbax@[EMAIL PROTECTED] (  2008-05-04 12:54:29 
Re: LEFT OUTER JOIN question
postgresql@[EMAIL PROTECT  2008-05-04 11:46:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 4:23:18 CDT 2008.