Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006
    Posts
    111

    Unanswered: Where Clause Filter

    I have an sql script that has 2 main blocks of Where filter which I'd call as Filter1 and Filter2 as follows:

    Select
    DisplayColumns...
    From
    InterestingTables
    Where
    (Filter1) --W1
    AND --W2
    NOT --W3
    (Filter2) --W4

    Note that Filter1 and Filter2 are composite filters (inner filters nested; it shouldn't matter as long as I have the outer parenthesis as above, right?).
    Now, say SetF1ExF2 is the result set of the sql script above.
    Additionally, let's say I obtain the result set SetF1 by having W2 to W4 commented out and SetF1AndF2 comes from commenting out W3.
    Shouldn't the following hold: SetF1AndF2 = SetF1 - SetF1ExF2
    I am having a discrepancy between the values with SetF1AndF2 < SetF1 - SetF1ExF2.

    TIA.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    your example too confused
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •