Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YEa11-0007N2-Iv for pgsql-admin@arkaria.postgresql.org; Fri, 23 Jan 2015 08:54:55 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YEa10-0007mo-No for pgsql-admin@arkaria.postgresql.org; Fri, 23 Jan 2015 08:54:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YEa0z-0007mi-K0 for pgsql-admin@postgresql.org; Fri, 23 Jan 2015 08:54:53 +0000 Received: from eu1sys200aog102.obsmtp.com ([207.126.144.113]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YEa0v-0000Y2-J5 for pgsql-admin@postgresql.org; Fri, 23 Jan 2015 08:54:51 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) (using TLSv1) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKVMIMVQtHXjEtZUJK7UvkgICuhNTEG4gy@postini.com; Fri, 23 Jan 2015 08:54:49 UTC Received: by mail-wi0-f179.google.com with SMTP id l15so1216528wiw.0 for ; Fri, 23 Jan 2015 00:54:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:content-type; bh=1J2zj5dC2aZZsWm6ihIa9vDQTzCXpPFsBUBtpBxfhq8=; b=TBBDcCvIoAhQHShIT9fQs1DUKAq4LCNmmD40czn57YnIls4G9pzvjIrBksADdq/AmZ cvR39Y09HmUMf+oNRBAQLPffEqHnkkFKomU4BKMr4P6Q+9GlX9fFGTBuhhYpNblnSEg/ S4FKfuTaU8MsXdySFcfgDQgw/V6IBO8Uwd/JywfIHuAXqNYQP7z3SjuU6Zy/KfSXN8T2 5adFCxNpNljYDyXBgigWDK5y/vh4QSsxDWlimWTqqkeQtgFaNYpVTgL8nx7cyRYFGr9q CHh05xr1bVUfcbmy+3IlhHyGhYDX8CqKAlA7owWS8gg4MONn08xArUwtaRO++dBr4WKg nxRw== X-Gm-Message-State: ALoCoQnXiVqGMcHla/ZEMRdivEM7Uf1uUkgIkMXesffLxr9aCtw3pAvMghh7nfB+zfZIJUnrqN3S5xBSj3g59erEPRHiFiu4/tOFMlLhCaobzDR+xjb6NPNXIbzn34XTyOwkD93Zye/3Sw0F4TQCZ2xzN3xBPBL5gA== X-Received: by 10.180.73.101 with SMTP id k5mr1419231wiv.43.1422003284289; Fri, 23 Jan 2015 00:54:44 -0800 (PST) X-Received: by 10.180.73.101 with SMTP id k5mr1419219wiv.43.1422003284176; Fri, 23 Jan 2015 00:54:44 -0800 (PST) From: Khangelani Gama References: In-Reply-To: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 thread-index: AQDQPhK/kgemgu4bGcJShpYJ0PfcGgE/JnEVApCtKHUCZ6UfvZ6bnHlg Date: Fri, 23 Jan 2015 10:54:43 +0200 Message-ID: <606493058e0101001739e7e29ffa3db7@mail.gmail.com> Subject: Re: PostgreSQL 9.2.4 - please assist with the query To: "Shabangu, Nicholus" , pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=f46d043c7efa9f880e050d4df06d X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --f46d043c7efa9f880e050d4df06d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank You very much, it works *From:* Shabangu, Nicholus [mailto:nicholus.shabangu@ebucks.com] *Sent:* 23 January 2015 10:46 AM *To:* Khangelani Gama; pgsql-admin@postgresql.org *Subject:* RE: [ADMIN] PostgreSQL 9.2.4 - please assist with the query You can remove the single quotes if it=E2=80=99s not text *From:* Khangelani Gama [mailto:kgama@argility.com] *Sent:* 23 January 2015 10:45 AM *To:* Shabangu, Nicholus; pgsql-admin@postgresql.org *Subject:* RE: [ADMIN] PostgreSQL 9.2.4 - please assist with the query Thank you =E2=80=A6I will try it *From:* Shabangu, Nicholus [mailto:nicholus.shabangu@ebucks.com] *Sent:* 23 January 2015 10:42 AM *To:* Khangelani Gama *Subject:* RE: [ADMIN] PostgreSQL 9.2.4 - please assist with the query I think you are looking for something like this select x, case when x =3D 71008 then =E2=80=9871007=E2=80=99 else x end from table...... SELECT * FROM test; a --- 1 2 3 SELECT a, CASE WHEN a=3D1 THEN 'one' WHEN a=3D2 THEN 'two' ELSE 'other' END FROM test; a | case ---+------- 1 | one 2 | two 3 | other *From:* pgsql-admin-owner@postgresql.org [mailto: pgsql-admin-owner@postgresql.org] *On Behalf Of *Khangelani Gama *Sent:* 23 January 2015 10:19 AM *To:* pgsql-admin@postgresql.org *Subject:* [ADMIN] PostgreSQL 9.2.4 - please assist with the query Hi I need help, I need to change every result with x being 71008 to be 71007 in the select query below. SELECT x, sum( value ) as value from table where =E2=80=A6=E2=80=A6.. Results will show as follows but if the query finds x as 71008 then it must make it 71007 instead. Is this possible? 71015 | 101240.00 71008 | -19351.34 CONFIDENTIALITY NOTICE The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of Argility (Proprietary) Limited and/or its subsidiaries. Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.If you are not the intended addressee please notify the writer immediately and destroy the e-mail. Argility (Proprietary) Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes. To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser: https://www.fnb.co.za/disclaimer.html If you are unable to access the Disclaimer, send a blank e-mail to firstrandbankdisclaimer@fnb.co.za and we will send you a copy of the Disclaimer. CONFIDENTIALITY NOTICE The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of Argility (Proprietary) Limited and/or its subsidiaries. Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.If you are not the intended addressee please notify the writer immediately and destroy the e-mail. Argility (Proprietary) Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes. To read FirstRand Bank's Disclaimer for this email click on the following address or copy into your Internet browser: https://www.fnb.co.za/disclaimer.html If you are unable to access the Disclaimer, send a blank e-mail to firstrandbankdisclaimer@fnb.co.za and we will send you a copy of the Disclaimer. CONFIDENTIALITY NOTICE The contents of and attachments to this e-mail are intended for the addre= ssee only, and may contain the confidential information of Argility (Proprietary) Limited and/or its subsidiaries. An= y review, use or dissemination thereof by anyone other than the intended addressee is prohibited.If you are not the intend= ed addressee please notify the writer immediately and destroy the e-mail. Argility (Proprietary) Limited and its subsidiari= es distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other tha= n strictly for business purposes. =0D --f46d043c7efa9f880e050d4df06d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Thank You very much, it works

=C2=A0

From: Sha= bangu, Nicholus [mailto:nic= holus.shabangu@ebucks.com]
Sent: 23 January 2015 10:46 AMTo: Khangelani Gama; = pgsql-admin@postgresql.org
Subject: RE: [ADMIN] PostgreSQL 9.= 2.4 - please assist with the query

=C2=A0

You can= remove the single quotes if it=E2=80=99s not text

=C2=A0

From: Khangelani Gama [mailto:kgama@argility.com]
Sent: 23 January 2015 10:45 AM
<= b>To: Shabangu, Nicholus; pgsql-admin@postgresql.org
Subject: RE: [ADMIN] PostgreSQL 9= .2.4 - please assist with the query

=C2=A0

Thank = you =E2=80=A6I will try it

=C2=A0

From: Shabang= u, Nicholus [mailto:nicholu= s.shabangu@ebucks.com]
Sent: 23 January 2015 10:42 AM
= To: Khangelani Gama
Subject: RE: [ADMIN] PostgreSQL 9.2.4 - p= lease assist with the query

= =C2=A0

I think you = are looking for something like this

select=C2=A0 x,

<= span style=3D"color:#1f497d">case when x =3D 71008 then =E2=80=9871007=E2=80=99

= else=C2=A0 x

=C2=A0end

=C2=A0from table......

=C2=A0

=C2=A0

=C2=A0

= =C2=A0

SELECT * FROM test;

=C2=A0

a

---

1

2<= /p>

3

=C2=A0

=C2=A0

SELECT a,

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CASE WHEN a= =3D1 THEN 'one'

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 WHEN a=3D2 THEN 'two'

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 ELSE 'other'

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 END

=C2=A0=C2=A0=C2=A0 FROM test= ;

=C2=A0

a | case

=

---+-------

1 | one

2 | two

3 | other

=C2=A0

=C2=A0

=C2=A0

From: pgsql-admin-ow= ner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Khangelan= i Gama
Sent: 23 January 2015 10:19 AM
To: pgsql-admin@postgresql.org
Subje= ct: [ADMIN] PostgreSQL 9.2.4 - please assist with the query

<= /div>

=C2=A0

Hi

<= p class=3D"MsoNormal">=C2=A0

I need help, I need = to change every result with x being 71008 to be 71007 in the select query b= elow.

=C2=A0

SELECT =C2= =A0x, sum( value ) as value from table where =E2=80=A6=E2=80=A6..

=C2=A0

Results will show as fol= lows but if the query finds x as 71008 then it must make it 71007 instead. = Is this possible?

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0

71015 | =C2=A0101240.00

71008 |=C2= =A0 -19351.34

=C2=A0 =C2=A0

=C2=A0

=C2=A0

=C2= =A0

=C2=A0

=C2=A0
=C2=A0
<= pre>CONFIDENTIALITY NOTICE
The contents of and attachments to thi=
s e-mail are intended for the addressee only, and may contain the confident=
ial
information of Argility (Proprietary) Limited and/or its subs=
idiaries. Any review, use or dissemination thereof by anyone
othe=
r than the intended addressee is prohibited.If you are not the intended add=
ressee please notify the writer immediately
and destroy the e-mai=
l. Argility (Proprietary) Limited and its subsidiaries distance themselves =
from and accept no liability
for unauthorised use of their e-mail=
 facilities or e-mails sent other than strictly for business purposes.
=C2=A0

To read FirstRan= d Bank's Disclaimer for this email click on the following address or co= py into your Internet browser:
https://www.fnb.co.za/disclaimer.html

=C2=A0

If you are unable = to access the Disclaimer, send a blank e-mail to firstrandbankdisclaimer@fnb.co.za and we wil= l send you a copy of the Disclaimer.

=C2=A0
=C2=A0=
CONFIDENTIALITY NOTICE
The contents of and attachments=
 to this e-mail are intended for the addressee only, and may contain the co=
nfidential
information of Argility (Proprietary) Limited and/or i=
ts subsidiaries. Any review, use or dissemination thereof by anyone
other than the intended addressee is prohibited.If you are not the inten= ded addressee please notify the writer immediately
and destroy th=
e e-mail. Argility (Proprietary) Limited and its subsidiaries distance them=
selves from and accept no liability
for unauthorised use of their=
 e-mail facilities or e-mails sent other than strictly for business purpose=
s.
=C2=A0

To read FirstRand Bank's Disclaimer for thi= s email click on the following address or copy into your Internet browser: =
https://www.fnb.co.za= /disclaimer.html


=C2=A0

If you are unable to access the Discl= aimer, send a blank e-mail to firstrandbankdisclaimer@fnb.co.za and we will send you a copy o= f the Disclaimer.


CONFIDENTIALITY NOTICE
The contents of and attachments to this e-mail are intended for the addre=
ssee only, and may contain the confidential
information of Argility (Proprietary) Limited and/or its subsidiaries. An=
y review, use or dissemination thereof by anyone
other than the intended addressee is prohibited.If you are not the intend=
ed addressee please notify the writer immediately
and destroy the e-mail. Argility (Proprietary) Limited and its subsidiari=
es distance themselves from and accept no liability
for unauthorised use of their e-mail facilities or e-mails sent other tha=
n strictly for business purposes.
=0D
--f46d043c7efa9f880e050d4df06d--