Re: Alternative to AS? - Mailing list pgsql-novice

From Helgi Örn
Subject Re: Alternative to AS?
Date
Msg-id AANLkTikYmg4CLjAu=QkPYFXu0LDAfvknkOntcjD2PO9M@mail.gmail.com
Whole thread Raw
In response to Alternative to AS?  (Helgi Örn <sacredeagle@gmail.com>)
Responses Re: Alternative to AS?  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-novice
Thank's for your effort Nathaniel.

2010/10/6 Nathaniel Trellice <naptrel@yahoo.co.uk>:
> Hi Helgi,
>
> I think your problem is not the 'AS', but is the way you're trying to format the time.
>
What I'm trying to do is fetch time from the database and transform it
into a 'human readable' format.

> I don't know what 'tid_in' is, but you might have some luck trying something along the lines of:
>
tid_in is the name of the column that is type TIME

> SELECT tid_in, to_char(tid_in, 'HH24.MI') AS format FROM timmar;
>
This does not work at all.

> The section 'Data Type Formatting Functions' (chapter 9.8) may be of a little help.
>
Believe me, I have read through this but in this case it hasn't helped
me the least.  What I miss in the postgres documentation i samples

> Nathaniel
>
>
> On 6 Oct 2010, at 09:58, Helgi Örn <sacredeagle@gmail.com> wrote:
>
>> Hi! I am moving a database project from MySQL to PostgreSQL I was a
>> newbie there and now I am a newbie here :)
>>
>> I have this form mysql:
>> SELECT tid_in, TIME_FORMAT(tid_in, '%H.%i')AS format FROM timmar;
>>
>> Which I have gotten postgre to accept thus far:
>> SELECT pack_tidin TIME_FORMAT, pack_tidin '%H.%i', AS format FROM timmar;
>>
>> it stops at AS which doesn't seem to exist is postgre, what is
>> postgres alternative to AS?
>>
>>
>> Thank's in advance,
>> Helgi Örn
>>

pgsql-novice by date:

Previous
From: Christian Ramseyer
Date:
Subject: Re: Alternative to AS?
Next
From: Thomas Kellerer
Date:
Subject: Re: Alternative to AS?