Re: Am I really stupid??? - Mailing list pgsql-general

From sidster
Subject Re: Am I really stupid???
Date
Msg-id 20000516235340.E230@3eye.boxsoft.com
Whole thread Raw
In response to Re: Am I really stupid???  (Alfred Perlstein <bright@wintelcom.net>)
List pgsql-general
* Alfred Perlstein (bright@wintelcom.net) [20000516 22:54]:

> In the meanwhile I think a better way to accomplish your query would
> be this:
>
> SELECT
>   t1.f2
> FROM
>   t1, t2
> WHERE
>   t1.f1 > 100 AND t2.f1 > 100
>   AND t1.f2 = t2.f2
> ;
>
> (I hope) :)


You really don't need the t2.f1 > 100 bit because of the latter join.

i.e.,

      SELECT
        t1.f2
      FROM
        t1, t2
      WHERE
        t1.f1 > 100 AND t1.f2 = t2.f2
      ;

should be sufficient.


Hope this helps,

patrick
--
Abstainer: a weak person who yields to the temptation of
denying himself a pleasure.
   -- Ambrose Bierce

pgsql-general by date:

Previous
From: "Nikolay Mijaylov"
Date:
Subject: simple question for users and db
Next
From: Dragos Stoichita
Date:
Subject: Re: Am I really stupid???