Re: What is *wrong* with this query???

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: What is *wrong* with this query???
Дата
Msg-id CAOR=d=1oV3nKxY7PuUJiUKeW+gX9Og_Xn_G4fL5W1gT3UrUgmg@mail.gmail.com
обсуждение исходный текст
Ответ на What is *wrong* with this query???  (Steve Murphy <smurphy@intorrent.com>)
Список pgsql-general
On Fri, Nov 4, 2011 at 10:51 PM, Steve Murphy <smurphy@intorrent.com> wrote:
> select schedule.id as sched_id, bld.id as bid
>     from
>         schedule
>         left join company on schedule.company = company.id
>         left join (select * from building where building.company =
> company.id order by id limit 1)  as bld
>     where
>         schedule.status = 'active' and company.status = 'active' and
> bld.status = 'active';

Looks like you need an on clause after the second left join.

В списке pgsql-general по дате отправления:

Предыдущее
От: Cstdenis
Дата:
Сообщение: Distinct on a non-sort column
Следующее
От: "David Johnston"
Дата:
Сообщение: Re: What is *wrong* with this query???