variables with SELECT statement

From: "Kevin Duffy" <KD(at)wrinvestments(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: variables with SELECT statement
Date: 2008-09-05 19:50:54
Message-ID: DFC309C8A42633419600522FA8C4AE1A560F16@mail-01.wrcapital.corp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello All:

I have a simple issue.

Within my table there is a field DESCRIPTION that I would like to parse
and split out into other fields.

Within DESCRIPTION there are spaces that separate the data items.
String_to_array(description, ' ') does the job very well.

I need something like this to work.

select string_to_array(description, ' ') as a_desc,

a_desc[0] as name , a_desc[1] as type, a_desc[2] as
size, from prodlist where type = 'B'

Need to parse the DESCRIPTION and then reference the pieces.

Your kind assistance is requested.

Thanks

Kevin Duffy

WR Capital Management

40 Signal Rd

Stamford, CT

203-504-6221

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Frank Bax 2008-09-05 20:07:15 Re: variables with SELECT statement
Previous Message Scott Marlowe 2008-09-05 16:16:03 Re: Correct Insert SQL syntax?