Hi,
I have an sql like this
select distinct b.field3
from
table1 a,
table2 b,
table3 c,
table4 d
where
c.field5="something" and
c.feild2=b.field2 and
(((b.field2=a.field2) and (b.field3=a.field3)) or
((b.field2=c.field2) and (b.field3=c.field3)))
when this is executed ((b.field2=a.field2) and (b.field3=a.field3)) is basically has no rows in the table hence the condition is something like null or somerows.
But even though the second condition((b.field2=c.field2) and (b.field3=c.field3)) is true
the end result is always 'no rows return'.why is it?
since the second condition is true and has rows and the first one is false and since i am using or shouldn't it return the rows.
I have an sql like this
select distinct b.field3
from
table1 a,
table2 b,
table3 c,
table4 d
where
c.field5="something" and
c.feild2=b.field2 and
(((b.field2=a.field2) and (b.field3=a.field3)) or
((b.field2=c.field2) and (b.field3=c.field3)))
when this is executed ((b.field2=a.field2) and (b.field3=a.field3)) is basically has no rows in the table hence the condition is something like null or somerows.
But even though the second condition((b.field2=c.field2) and (b.field3=c.field3)) is true
the end result is always 'no rows return'.why is it?
since the second condition is true and has rows and the first one is false and since i am using or shouldn't it return the rows.