• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

LEFt OUTER JOIN returning extraneous results...

 
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys...I have a left outer join query, and i noticed it returned too many results...
So now Im testing its logic by simplifying it.
I decided to do a control test, where the query returns 0 results.

I implemented this test by putting 1=0 as a criteria in the where clause (see below) ...

Anyways. My query is returning results !!! Why ? Shouldnt the 1=0 statement always evaluate to false, thus
making the only set of attributes which satisfy this criteria the null set (i.e. the empty set )?

 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The last set of OR clauses aren't wrapped in parens

 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay... Thanks !!!

But this raises another question about left outer joins...

The idea of the left outer join is that someone wants to see all the records from A, along with any entries from table B,C,D,E... etc.

But if thats the case, how are constraints applied to rows on the non essential tables in a left outer join ?

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic