"left join" not working?

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема "left join" not working?
Дата
Msg-id 20100212111453.GA16318@apartia.fr
обсуждение исходный текст
Ответы Re: "left join" not working?  (msi77 <msi77@yandex.ru>)
Список pgsql-sql
Hi,

This query:

select c.id_currency,max(p.modified_on) from currency c left join
price_line p using (id_currency) where p.id_line=1 group by
c.id_currency;

doesn't list all c.id_currency's, only those with a price_line. However
this one does:

select c.id_currency,max(p.modified_on) from currency c left join
price_line p on (p.id_currency = c.id_currency and p.id_line=1) group by
c.id_currency;

How come?

Thanks,


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

Предыдущее
От: Jasen Betts
Дата:
Сообщение: Re: 'image' table with relationships to different objects
Следующее
От: "Oliveiros C,"
Дата:
Сообщение: Re: "left join" not working?