Re: Need help with (tricky?) select

From: Michael P. Stein <mstein_at_access.digex.net>
Date: 20 Apr 1994 19:31:20 -0400
Message-ID: <2p4e08$jqa_at_access2.digex.net>


>Here is the query you want!
>1> select T1.city, T1.state, T2.city, T2.state
>2> from testit T1, testit T2
>3> where T1.city != T2.city
>4> and T1.state != T2.state

    ^^^

        This should be OR, not AND. Think of what happens if you insert both Buffalo and Albany NY. The states are equal, so the AND fails; therefore the intrastate trip does not print out.

-- 
Mike Stein			The above represents the Absolute Truth.
POB 10420			Therefore it cannot possibly be the official
Arlington, VA  22210		position of my employer.
Received on Thu Apr 21 1994 - 01:31:20 CEST

Original text of this message