Re: [GENERAL] select from into question

Поиск
Список
Период
Сортировка
От Stuart Barlow
Тема Re: [GENERAL] select from into question
Дата
Msg-id 37412BE6.20172891@peopledoc.com
обсуждение исходный текст
Список pgsql-general
When you get the information that needs to be stored in the database I guess
that the data should be split into seperate fields.

You should really have a seperate field for categoryName, subcategory,
otherInfo and number. They are all different pieces of information and so
should be in seperate fields.

If you were using Perl to talk to the database then the string manipulation
to extract the / delimited fields would be simple. But most languages will
give you the string manipulation needed.

Kevin Heflin wrote:

> Just hoping some magic SQL can get me out of this one easily enough.
> I have a field of type varchar a sample would look something like this:
> 'categoryname/subcategoryname/someotherinformation/012345'

> all I want in this field is that last bit of information after the last
> '/' ie: '012345'
> I'd like to either replace this field with this number alone or insert
> into another newly created field.
> Any suggestions would be appreciated.
> Kevin
> --------------------------------------------------------------------
> Kevin Heflin          | ShreveNet, Inc.      | Ph:318.222.2638 x103
> VP/Mac Tech           | 333 Texas St #175    | FAX:318.221.6612
> kheflin@shreve.net    | Shreveport, LA 71101 | http://www.shreve.net
> --------------------------------------------------------------------

Ta.
--
Stuart Barlow
PeopleDoc Ltd. (+44 131 468 8205)



В списке pgsql-general по дате отправления:

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: subscribe
Следующее
От: Stuart Rison
Дата:
Сообщение: Problems with '||' concatenation operator.