Re: Query with conditional statement - Mailing list pgsql-sql

From David G. Johnston
Subject Re: Query with conditional statement
Date
Msg-id CAKFQuwa5n3OOz2-i7T=9oLfHNUxipeEAzFBXz2OETnOL3BX6xQ@mail.gmail.com
Whole thread Raw
In response to Query with conditional statement  (JORGE MALDONADO <jorgemal1960@gmail.com>)
List 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 by date:

Previous
From: "Tchouante, Merlin"
Date:
Subject: RE: Query with conditional statement
Next
From: Mehmet Sabri KUNT
Date:
Subject: Re: Query with conditional statement