Re: How can I create null value from function call with no results?

Поиск
Список
Период
Сортировка
От Marc Mamin
Тема Re: How can I create null value from function call with no results?
Дата
Msg-id B6F6FD62F2624C4C9916AC0175D56D8828AC3CEF@jenmbs01.ad.intershop.net
обсуждение исходный текст
Ответ на Re: How can I create null value from function call with no results?  (Seref Arikan <serefarikan@gmail.com>)
Список pgsql-general
> I want to call a function using a column of a table as the parameter and
> return the parameter and function results together.
> The problem is, when the function returns an empty row my select statement
> that uses the function returns an empty row as well.

Hello,
not sure if it makes sense in your context, but something like this could do the job:

WITH SEL AS ( Your Query)
SELECT * FROM SEL
UNION ALL
SELECT  'nothing found' WHERE NOT EXISTS ( select * from sel);

regards,

Marc Mamin

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Postgress Doubts
Следующее
От: Kynn Jones
Дата:
Сообщение: How to implement a uniqueness constraint across multiple tables?