Re: Is there a way to replace select * fields in result ?

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Condor <condor(at)stz-bg(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Is there a way to replace select * fields in result ?
Date: 2021-06-12 09:15:37
Message-ID: 09C5EA9B-5BC3-441E-B4BC-484393085DB5@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On 12 Jun 2021, at 10:00, Condor <condor(at)stz-bg(dot)com> wrote:
>
> select qw.*, case whem length(qw.mm) > 0 THEN COALESCE(SUBSTRING(qw.mm, 1, 1), '') ELSE qw.mm END AS qw.mm

A little off-topic, but isn’t that a roundabout way of writing just this?:

select qw.*, coalesce(substring(qw.mm, 1, 1), '') as mm

Or even:

select qw.*, coalesce(left(qw.mm, 1), '') as mm

Regards,

Alban Hertroys
--
There is always an exception to always.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shubham Mittal 2021-06-12 11:35:24 How to generate file from postgres data
Previous Message Condor 2021-06-12 08:18:50 Re: Is there a way to replace select * fields in result ?