variables with SELECT statement - Mailing list pgsql-sql

From Kevin Duffy
Subject variables with SELECT statement
Date
Msg-id DFC309C8A42633419600522FA8C4AE1A560F16@mail-01.wrcapital.corp
Whole thread Raw
Responses Re: variables with SELECT statement
List 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

 

pgsql-sql by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Correct Insert SQL syntax?
Next
From: Frank Bax
Date:
Subject: Re: variables with SELECT statement