Re: Returning a table from a function, that requires multipleselects?

Поиск
Список
Период
Сортировка
Искать
От
Rob Sargent
Тема
Re: Returning a table from a function, that requires multipleselects?
Дата
Msg-id
97A82FDB-C59B-4B7E-8B4E-788E27E50322@gmail.com
Ответ на
Список
Дерево обсуждения
Returning a table from a function, that requires multiple selects? stan <stanb@panix.com>
Re: Returning a table from a function, that requires multipleselects? stan <stanb@panix.com>
Re: Returning a table from a function, that requires multipleselects? Rob Sargent <robjsargent@gmail.com>
Re: Returning a table from a function, that requires multipleselects? Guyren Howe <guyren@gmail.com>
Re: Returning a table from a function, that requires multipleselects? Rob Sargent <robjsargent@gmail.com>
Re: Returning a table from a function, that requires multiple selects? Tom Lane <tgl@sss.pgh.pa.us>


On Aug 30, 2019, at 2:03 PM, stan <stanb@panix.com> wrote:

I need to encapsulate, what are basically 2 related function calls into a single
function. The result of each of th calls is a date type.

y current thinking is to return a 2 row table with the 2 dates in it. But, I seem to
be having issues getting this to work.

Is it possible for a function to return a table with results from multiple
queries?

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin


If the two queries are identical in returned columns you might be able to use UNION:
select f1.* from first_query as f1 UNION select f2.* from second_query as f2;

You can’t do any processing of f1 or f2.

В списке pgsql-general по дате отправления
От: stan
Дата:
От: Guyren Howe
Дата:
FAQ