retrieving specific info. from one column and locating it in another

From: MARC BEDOIS <mbedois(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: retrieving specific info. from one column and locating it in another
Date: 2002-11-21 14:11:57
Message-ID: 20021121141157.69252.qmail@web40002.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I'm trying to retrieve some info from one column and
put it in another. I have a column that has a bunch
of information in it called 'Route'. I don't need to
show all of that information. Instead I need divide
that single column into two seperate columns called
'Sender' and 'Receiver'. How do I divide this
information up into these two columns. I know of
methods called charindex and patindex. I need to do
something like that but instead of returning the
position of the info, to just return the selected
info.
Ex) I have a column named Route....with info in it
similar to 'UPS NS Ground'
How do I create a second column called
'Delivery' and pull only the 'NS' out of the Route
column and put it into the 'Reciever' column?
Similarly how would I pull just the UPS part
out of Route and put it into 'Sender'?

thanks,
Marc

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Galbavy 2002-11-21 14:22:51 help optimise this ?
Previous Message Ian Barwick 2002-11-21 14:11:26 Re: [SQL] psql on FreeBSD 4.7-RELEASE-p2 and greek (iso8859-7) chars