Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id EC0C2633390 for ; Thu, 27 May 2010 11:02:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 27853-05 for ; Thu, 27 May 2010 14:02:02 +0000 (UTC) X-Greylist: delayed 00:06:40.273433 by SQLgrey-1.7.6 Received: from web27907.mail.ukl.yahoo.com (web27907.mail.ukl.yahoo.com [217.146.182.57]) by mail.postgresql.org (Postfix) with SMTP id 4CA26633041 for ; Thu, 27 May 2010 11:02:04 -0300 (ADT) Received: (qmail 32122 invoked by uid 60001); 27 May 2010 13:55:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1274968521; bh=gstDt9UfK+vjDg3BC48bG7WA7+E8NfVwg/6Ix/Alafg=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=e2og4aplQwiyRNto5+/K6zoL0YdPnGEoKiiM3ZcLFo3GG5knlBA5845cEM+R/rcflNyuNhJeWFVKDSHqGQWgCtfPBk83URrl3PeQ6kpTbXn1eARpfXl6Gbhh28L285KAL/yD40I0OYE2pIcZSyTD1/9CF0YdGWVF7jza6PvM2us= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.uk; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=acS88oPKhZIV0yP/zrbZavPnpqF1/KDQ2EN53dtrEMT/1ir+iAyy+QadHwDalx195YVKdCBNA/1gUHvahCOaOmplIuRooU0HClN3K6ZXK5rSTbYDodBxImy4W4kCpFTNvYFh+7oKOhj9tksYP/Dey7qiYf7MthXvweTuE2tzayA=; Message-ID: <661576.31727.qm@web27907.mail.ukl.yahoo.com> X-YMail-OSG: OLtWrhwVM1m9OQ0ZCybpwULC54pc5fFwTEeHS_XkBuZCLER xm7RmUOtMpd7Za_.LmLEdRDq27RntMSEF5Lt9iZI2ryemMsjNwKPOycorRZa YpGCm7w5ENOF_7zNpYn93TwI5Y_xjxQcaE50IXsPLyfI.EOAMv_XV3RZ869j cYEWeYFZoGhh.9tGugN5dlkrdkoLETEQNvxZMFNRx_c5CiPXNWz2AujUq2N0 cSIC1HiI5JNiVuGU6eEkAhYsl66U4oYNIfOqhkvB6i9flmA-- Received: from [172.16.10.68] by web27907.mail.ukl.yahoo.com via HTTP; Thu, 27 May 2010 13:55:21 GMT X-Mailer: YahooMailClassic/11.0.8 YahooMailWebService/0.8.103.269680 Date: Thu, 27 May 2010 13:55:21 +0000 (GMT) From: James Kitambara Subject: Fw: Re: help To: Kenichiro Arakaki Cc: pgsql-sql MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1496045746-1274968521=:31727" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.801 tagged_above=-5 required=5 tests=BAYES_50=0.8, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201005/128 X-Sequence-Number: 34176 --0-1496045746-1274968521=:31727 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable --- On Thu, 27/5/10, James Kitambara wrote: From: James Kitambara Subject: Re: [SQL] help To: "Nicholas I" Date: Thursday, 27 May, 2010, 14:50 Hello Mr. Nicholas, =A0 You can try the following: =A0 THIS IS WHAT I TRIED TO SOLVE YOUR PROBLEM, BUT IN ORACLE DBMS (SORRY I DON'T HAVE POSTGRESQL INSTALL ON MY COMPUTER) i GUESS YOU CAN TRY TO CHANGE THE SQL COMMANDS IN POSTGRESQL create table numbers ( =A0id number not null primary key, =A0description varchar2(100) ); insert into numbers values (300, 'Three hundred (300)'); insert into numbers values (350, 'Three hundred fifty (350)'); insert into numbers values (6709, 'Six thousand seven hundred and nine (670= 9)'); =A0 select id, description, substr(description, instr(description, '(') +1, ins= tr(description, ')')-(instr(description, '(') +1)) extracted_character from numbers; This is the Results: ID=A0=A0=A0=A0 DESCRIPTION=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 EXTRACTED_CHARACTERS ---------------------------------------------------------------------------= ------------------------------------- 300=A0=A0=A0 Three hundred=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0 300 350=A0=A0=A0 Tree hundred fifty=A0=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0350 6709=A0=A0 Six thousand seven hundred and nine =A0=A0 =A06709 =A0 But if you run the following query you will get exactlly what: select substr(description, instr(description, '(') +1, instr(description, '= )')-(instr(description, '(') +1)) extracted_character from numbers: This is the Results: EXTRACTED_CHARACTERS ------------------------- =A0 300 =A0 350 =A0 6709 =A0 James Kitambara B.Sc. With Computer Science and Statistics (Hons), =A0 --- On Wed, 5/5/10, Nicholas I wrote: From: Nicholas I Subject: [SQL] help To: pgsql-sql@postgresql.org Date: Wednesday, 5 May, 2010, 4:05 Hi, I have a table in which the data's are entered like, Example: One (1) Two (2) Three (3) I want to extract the data which is only within the parentheses. that is=20 1 2 3 Thank You Nicholas I =0A=0A=0A --0-1496045746-1274968521=:31727 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable

--- On Thu, 27/5/10, James Kitambara <= I><jameskitambara@yahoo.co.uk> wrote:

From: James Kitambara <jameskitambara@yahoo.co= .uk>
Subject: Re: [SQL] help
To: "Nicholas I" <nicholas.domnic.= i@gmail.com>
Date: Thursday, 27 May, 2010, 14:50


Hello Mr. Nicholas,
 
You can try the following:
 
THIS IS WHAT I TRIED TO SOLVE YOUR PROBLEM, BUT IN ORACLE DBMS
(SOR= RY I DON'T HAVE POSTGRESQL INSTALL ON MY COMPUTER)
i GUESS YOU CAN TRY T= O CHANGE THE SQL COMMANDS IN POSTGRESQL

create table numbers (
 id number not null primary key, description varchar2(100)
);

insert into numbers values (300, 'Three hundred (300)');
insert= into numbers values (350, 'Three hundred fifty (350)');
insert into num= bers values (6709, 'Six thousand seven hundred and nine (6709)');
 

select id, description, substr(description, instr(description, '('= ) +1, instr(description, ')')-(instr(description, '(') +1)) extracted_chara= cter
from numbers;
This is the Results:
ID     DESCRIPTION     &n= bsp;            = ;            EXTRACT= ED_CHARACTERS
----------------------------------------------------------= ------------------------------------------------------
300  &n= bsp; Three hundred          &n= bsp;            = ;             &= nbsp;  300
350    Tree hundred fifty  &nbs= p;             =             &nb= sp;     350
6709   Six thousand seven hund= red and nine     6709
 
But if you run the following query you will get exactlly what:
select substr(description, instr(description, '(') +1, instr(descripti= on, ')')-(instr(description, '(') +1)) extracted_character
from numbers:=
This is the Results:
EXTRACTED_CHARACTERS
-------------------------
  300
&nb= sp; 350
  6709

 
James Kitambara
B.Sc. With Comput= er Science and Statistics (Hons),
<= /DIV> 


--- On Wed, 5/5/10, Nich= olas I <nicholas.domnic.i@gmail.com> wrote:

From: Nicholas I <nicholas.domnic.i@gmail.com&= gt;
Subject: [SQL] help
To: pgsql-sql@postgresql.org
Date: Wednesd= ay, 5 May, 2010, 4:05

Hi,

I have a table in which the data's are e= ntered like,

Example:

One (1)
Two (2)
Three (3)

= I want to extract the data which is only within the parentheses.

tha= t is
1
2
3


Thank You
Nicholas I


<= br>=0A=0A=0A=0A --0-1496045746-1274968521=:31727--