pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Kenneth Gonsalves <lawgon@thenilgiris.com>
Cc: Andreas Kretschmer <akretschmer@despammed.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: [despammed] sql can i substitute
Date: Fri, 17 Dec 2004 16:08:53 +0200 (EET)
Message-ID: <Pine.LNX.4.44.0412171607390.27921-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <0412171831181R.06834@thenilgiris.com>

O Kenneth Gonsalves Ýãñáøå óôéò Dec 17, 2004 :

> On Friday 17 December 2004 05:54 pm, Andreas Kretschmer wrote:
> 
> > Yes, simple:
> >
> > test=# select name,  case
> > test-# when fruit = 1 then 'good'
> > test-# when fruit = 2 then 'bad'
> > test-# when fruit = 3 then 'rotten' end as fruit from fruit;
> 
> can one do the same thing for an 'insert' statement?

its an expression, so yes, 
INSERT INTO foo3 VALUES (2,case when 't' then 'bar' else 'foo' end);
but whats the point?

> 
> kg
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 

-- 
-Achilleus




view thread (10+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0412171607390.27921-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0412171607390.27921-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0412171607390.27921-100000@matrix.gatewaynet.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: achill@matrix.gatewaynet.com, lawgon@thenilgiris.com, akretschmer@despammed.com
  Subject: Re: [despammed] sql can i substitute
  In-Reply-To: <Pine.LNX.4.44.0412171607390.27921-100000@matrix.gatewaynet.com>
  References: <0412171831181R.06834@thenilgiris.com> <Pine.LNX.4.44.0412171607390.27921-100000@matrix.gatewaynet.com>

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

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