Re: [SQL] substring

Поиск
Список
Период
Сортировка
От Nuchanard Chiannilkulchai
Тема Re: [SQL] substring
Дата
Msg-id 3726F8D8.85E9B69A@valigene.com
обсуждение исходный текст
Ответ на Re: [SQL] substring  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Tom Lane wrote:

> Nuchanard Chiannilkulchai <nuch@valigene.com> writes:
> > The problem is : select  position ('_' in a ) from table_a  does not
> > work.
> >  ERROR:  No such function 'strpos' with the specified attributes
>
> Hmm, I don't see that under either 6.4.2 or current sources.
>
> What data type is your column a?  I tried text and char(n) and neither
> one gave an error...
>
>                         regards, tom lane
   the datatype of a is char(8).
   select a, substring(a from 1 for position('_' in a) - 1) as part from
test;   This solution from José works great, THANX.
   Nuch





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

Предыдущее
От: Christophe Labouisse
Дата:
Сообщение: Re: [SQL] Strange behavior
Следующее
От: Herouth Maoz
Дата:
Сообщение: Re: [SQL] OUTER JOINS