Re: How to return a default value if no result

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: How to return a default value if no result
Дата
Msg-id 1408716445855-5815860.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: How to return a default value if no result  ("Rob - TEAM Systems Ltd" <rob@teamsystems.co.uk>)
Ответы Re: How to return a default value if no result  ("Rob - TEAM Systems Ltd" <rob@teamsystems.co.uk>)
Список pgsql-novice
Rob Northcott wrote
> Is there a nice way of forcing a default result somehow?

The Coalesce function is your friend:

SELECT COALESCE( (SELECT subquery), <default> )

David J.



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/How-to-return-a-default-value-if-no-result-tp5815850p5815860.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


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

Предыдущее
От: "Rob - TEAM Systems Ltd"
Дата:
Сообщение: Re: How to return a default value if no result
Следующее
От: "Rob - TEAM Systems Ltd"
Дата:
Сообщение: Re: How to return a default value if no result