Re: getting a query column to return 0 if nothing matches

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: getting a query column to return 0 if nothing matches
Дата
Msg-id 20060104024246.GA10993@winnie.fuhr.org
обсуждение исходный текст
Ответ на getting a query column to return 0 if nothing matches  (Dan Tenenbaum <dandante@gmail.com>)
Список pgsql-sql
On Tue, Jan 03, 2006 at 02:15:25PM -0800, Dan Tenenbaum wrote:
> I want to show all rows where the first part of the WHERE clause is true,
> regardless of whether the provider_key is in the login_provider table (in
> that cause, I want to show 0 in that column).

Sounds like you're looking for an outer join.

http://www.postgresql.org/docs/8.1/interactive/tutorial-join.html
http://www.postgresql.org/docs/8.1/interactive/queries-table-expressions.html

-- 
Michael Fuhr


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

Предыдущее
От: frank church
Дата:
Сообщение: Loading lots of data in a SQL command
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Loading lots of data in a SQL command