Re: postgres function

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: postgres function
Дата
Msg-id 561FC05E.3000509@joeconway.com
обсуждение исходный текст
Ответ на Re: postgres function  (Ramesh T <rameshparnanditech@gmail.com>)
Список pgsql-general
On 10/15/2015 07:05 AM, Ramesh T wrote:
> '123-987-123' it is not fixed some times it may be '1233-9873-123-098'
> as you said it's fixed,
>
> changes the values in middle of the -
>
> sometimes times i need 1233 and 098 or 9873,first position  i'll find
> direct for second variable we don't know where it's end with -
>
> i.e ,
> i need to find second postition of the variable between the '-'

Are you looking for the position or the actual variable? If you really
want the latter you can do:

select split_part('123-987-123','-',2);
select split_part('1233-9873-123-098','-',2);

Joe

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development


Вложения

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Installing plpython3u
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: question