Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A74C99FBD17 for ; Fri, 16 Feb 2007 09:52:32 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 31683-05 for ; Fri, 16 Feb 2007 09:52:24 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by postgresql.org (Postfix) with ESMTP id 34DD79FBC63 for ; Fri, 16 Feb 2007 09:52:24 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so132981ugf for ; Fri, 16 Feb 2007 05:52:23 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=bPfhDNjtvQwDNng37vEo0cnsfEEGjT0yGpL12YCA84CfZzaQpErY4SbvaGyACJiXvhy/GdRu9ILcdNNabOX1B6HzQMfVIyAh2lkxMDCmWH9IDnoh9UJsVe1o0JTGD/FrC3kfx+ftFm/WiU1i3d06eu2YuACZ0QL+t4ApkLInjok= Received: by 10.66.252.4 with SMTP id z4mr2865528ugh.1171627792444; Fri, 16 Feb 2007 04:09:52 -0800 (PST) Received: by 10.66.217.13 with HTTP; Fri, 16 Feb 2007 04:09:52 -0800 (PST) Message-ID: <55c095e90702160409m7bc87311q60fa92643ef2afe5@mail.gmail.com> Date: Fri, 16 Feb 2007 09:09:52 -0300 From: "Ezequias Rodrigues da Rocha" To: "Phillip Smith" Subject: Re: Retrieving 'Credit' when 'C' Cc: pgsql-sql@postgresql.org In-Reply-To: <004001c7514a$daf02730$9b0014ac@wbaus090> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4354_8331694.1171627792394" References: <55c095e90702150844h3159bfbbx83c71b6910f4a88f@mail.gmail.com> <004001c7514a$daf02730$9b0014ac@wbaus090> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/174 X-Sequence-Number: 27508 ------=_Part_4354_8331694.1171627792394 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Perfect, I learn this lesson now. This case is quite good. My Best Regards Ezequias 2007/2/15, Phillip Smith : > > SELECT when, > > CASE WHEN type =3D 'C' THEN 'Credit' END AS type > > FROM mytable; > > > > Assuming your column names are actually "when" and "type" you should just > have to change "mytable" to the correct table name and run in psql or the > SQL Window of pgAdmin or wherever you usually run your SQL queries to get > what you want. > > > > > > -----Original Message----- > *From:* pgsql-sql-owner@postgresql.org [mailto: > pgsql-sql-owner@postgresql.org] *On Behalf Of *Ezequias Rodrigues da Roch= a > *Sent:* Friday, 16 February 2007 03:45 > *To:* Ezequias Rodrigues da Rocha; pgsql-sql@postgresql.org > *Subject:* Re: [SQL] Retrieving 'Credit' when 'C' > > > > Just a question, where to put it ? I didn't notice yet. > > ********************Confidentiality and Privilege > Notice******************** > > The material contained in this message is privileged and confidential to > the addressee. If you are not the addressee indicated in this message or > responsible for delivery of the message to such person, you may not copy = or > deliver this message to anyone, and you should destroy it and kindly noti= fy > the sender by reply email. > > Information in this message that does not relate to the official business > of Weatherbeeta must be treated as neither given nor endorsed by > Weatherbeeta. Weatherbeeta, its employees, contractors or associates shal= l > not be liable for direct, indirect or consequential loss arising from > transmission of this message or any attachments > > --=20 =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- A pior das democracias ainda =E9 melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ------=_Part_4354_8331694.1171627792394 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Perfect,

I learn this lesson now. This case is quite good.

My= Best Regards
Ezequias

=
2007/2/15, Phillip Smith < phillip.smith@weatherbeeta.com.au>:

SELECT      when,

CASE WHEN type =3D 'C= 9; THEN 'Credit' END AS type

FROM        mytable;

 

Assuming your column names are act= ually "when" and "type" you should just have to change "mytable" to the correct table name and run in psql or the SQL Window of pgAdmin or wher= ever you usually run your SQL queries to get what you want.

 

 

-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@p= ostgresql.org] On Behalf Of Ezequias Rodrigues da Rocha
Sent:
Friday, 16 February 2007 03:45

To: Ezequias Rodrigues da = Rocha; pgsql-sql@postgresql.org Subject: Re: [SQL] Retriev= ing 'Credit' when 'C'

<= span style=3D"font-size: 12pt;"> 

<= span style=3D"font-size: 12pt;">Just a question, where to put it ? I didn't notice yet.


*******************Confidentiality and Privilege Notice*****************= **

The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email.

Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbee= ta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of thi= s message or any attachments




--
=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
      = ;            &n= bsp;            = ;   Atenciosamente (Sincerely)
    &n= bsp;            = ;       Ezequias Rodrigues da Rocha
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -
A pior das democracias ainda =E9 melhor do que a melhor das ditaduras<= br>The worst of democracies is still better than the better of dictatorship= s
http://ezequiasrocha.blo= gspot.com/ ------=_Part_4354_8331694.1171627792394--