public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: JORGE MALDONADO <[email protected]>
Cc: [email protected]
Subject: Re: Query with conditional statement
Date: Wed, 13 Sep 2023 11:07:05 -0700
Message-ID: <CAKFQuwa5n3OOz2-i7T=9oLfHNUxipeEAzFBXz2OETnOL3BX6xQ@mail.gmail.com> (raw)
In-Reply-To: <CAAY=A78qufOUD+GLZVjNwLgBer2DxtJsHrc3h7H8r33_yuhrTw@mail.gmail.com>
References: <CAAY=A78qufOUD+GLZVjNwLgBer2DxtJsHrc3h7H8r33_yuhrTw@mail.gmail.com>

On Wed, Sep 13, 2023 at 10:53 AM JORGE MALDONADO <[email protected]>
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.


view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Query with conditional statement
  In-Reply-To: <CAKFQuwa5n3OOz2-i7T=9oLfHNUxipeEAzFBXz2OETnOL3BX6xQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox