Skip site navigation (1) Skip section navigation (2)

Re: [despammed] sql can i substitute

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: Kenneth Gonsalves <lawgon(at)thenilgiris(dot)com>
Cc: Andreas Kretschmer <akretschmer(at)despammed(dot)com>,<pgsql-sql(at)postgresql(dot)org>
Subject: Re: [despammed] sql can i substitute
Date: 2004-12-17 14:08:53
Message-ID: Pine.LNX.4.44.0412171607390.27921-100000@matrix.gatewaynet.com (view raw or flat)
Thread:
Lists: pgsql-sql
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


In response to

pgsql-sql by date

Next:From: Marcus ClaessonDate: 2004-12-17 14:32:31
Subject: Re: can't get the order I want after inserting new rows
Previous:From: Kenneth GonsalvesDate: 2004-12-17 13:01:18
Subject: Re: [despammed] sql can i substitute

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group