Re: Am I really stupid???

Поиск
Список
Период
Сортировка
От sidster
Тема Re: Am I really stupid???
Дата
Msg-id 20000516235340.E230@3eye.boxsoft.com
обсуждение исходный текст
Ответ на Re: Am I really stupid???  (Alfred Perlstein <bright@wintelcom.net>)
Список 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 по дате отправления:

Предыдущее
От: "Nikolay Mijaylov"
Дата:
Сообщение: simple question for users and db
Следующее
От: Dragos Stoichita
Дата:
Сообщение: Re: Am I really stupid???