Is the line of code below redundant? [message #202446] |
Thu, 09 November 2006 21:05 |
philips84
Messages: 1 Registered: November 2006
|
Junior Member |
|
|
hi,
Looking at the query given below, I would like to know is "t2.cola IS NOT NULL" redundant in the second LEFT JOIN condition?
select * from ((t1
left join t2 on t1.cola = t2.cola AND t1.cola is null and t2.cola is null)
left join t3 on t2.cola = t3.cola AND t2.cola is null and t3.cola is null)
Since, i have defined it in the first context, do i need to define it again in the second context?
Thanks,
Phil
|
|
|
|
Re: Is the line of code below redundant? [message #202644 is a reply to message #202486] |
Fri, 10 November 2006 12:05 |
skooman
Messages: 913 Registered: March 2005 Location: Netherlands
|
Senior Member |
|
|
Furthermore, since you use join and not outerjoin, all the "is not null" parts are redundant... Join means equijoin and since null=null evaluates to null (read: I don't know, how can I tell if something I don't know the value of equals something else I don't know the value of?), all the null values will be eliminated from the result anyway.
All this assuming that you meant to type IS NOT NULL, instead of IS NULL (as is says in your post). Joining tables on columns you want to contain null doesn't make much sense, does it?
Regards,
Sabine
|
|
|