Re: SELECT question

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: SELECT question
Дата
Msg-id 200311041114.14676.dev@archonet.com
обсуждение исходный текст
Ответ на SELECT question  (Alex <alex@meerkatsoft.com>)
Список pgsql-general
On Tuesday 04 November 2003 10:54, Alex wrote:
> Hi,
>
> I have a bit string , 7 bits, every bit representing a day of the week.
> e.g. 1110011.
> Is there and easy way where I can translate/format that string in a query.
> I want to give the string back with a '-' for every 0 and the first char
> of the Day for every '1'.
> example 1100111 = SM--TFS.

You probably want a small function in plpgsql - see the procedural languages
section of the manual for details. You might want to check the cookbook at
http://techdocs.postgresql.org/ and see if there's similar code you can use
as inspiration.

--
  Richard Huxton
  Archonet Ltd

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Obtain boolean value of expression in PLPGSQL
Следующее
От: Rob Fielding
Дата:
Сообщение: pg7.3.4: pg_atoi: zero-length string