Re: SELECT question

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Brent Wood <b(dot)wood(at)niwa(dot)co(dot)nz>
Cc: Alex <alex(at)meerkatsoft(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT question
Date: 2003-11-04 23:25:23
Message-ID: 3FA83563.8000309@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Brent Wood wrote:
>
> On Tue, 4 Nov 2003, 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 could write a Postgres function to do this, depending on your
> programming skills, but you did ask for a query based solution.

See attachment

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

Attachment Content-Type Size
testdb.sql text/plain 778 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message ljb 2003-11-05 00:50:29 Re: PostgreSQL v7.4 Release Candidate 1
Previous Message Razvan Surdulescu 2003-11-04 22:57:16 Re: INSERT performance