Re: Query with conditional statement

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Query with conditional statement
Дата
Msg-id CAKFQuwa5n3OOz2-i7T=9oLfHNUxipeEAzFBXz2OETnOL3BX6xQ@mail.gmail.com
обсуждение исходный текст
Ответ на Query with conditional statement  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список pgsql-sql
On Wed, Sep 13, 2023 at 10:53 AM JORGE MALDONADO <jorgemal1960@gmail.com> wrote:
I need to return more than 1 field on each WHEN and also assign an ALIAS.


You can only produce a single value of a specific data type from the output of a case expression.   To do what you desire, create a custom composite type and return that.  You get to name the fields when you define the composite type.

David J.

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

Предыдущее
От: "Tchouante, Merlin"
Дата:
Сообщение: RE: Query with conditional statement
Следующее
От: Mehmet Sabri KUNT
Дата:
Сообщение: Re: Query with conditional statement