From: | "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> |
---|---|
To: | jrivero <godsea(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Join three fields into one on same table |
Date: | 2008-05-19 21:35:27 |
Message-ID: | dcc563d10805191435l32e257f0sc82a23f86fedd5b@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Is there a good reason to NOT store the year month and day as a date
instead of this way?
I can think of a lot of very good reasons to store it as a date, not a
lot of reasons to store them broken apart.
On Mon, May 19, 2008 at 4:51 AM, jrivero <godsea(at)gmail(dot)com> wrote:
> Hi, i need help for a query. I have three fields, year, month and day
> into table and need join and update another field named date on same
> table.
>
> My problem is not that make update query.
>
> With this query have the value of the update:
>> select year || '-' || month || '-' || day || ' 01:00:00' as newdate from table
>
> but this another query not have correct syntax...
>> update table set date=(select year || '-' || month || '-' || day || ' 01:00:00' as newdate from table)
>
> Regards,
> Jordi
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Marlowe | 2008-05-19 21:36:39 | Re: Join three fields into one on same table |
Previous Message | Scott Marlowe | 2008-05-19 21:34:20 | Re: Setting up phppgadmin under https/ssl (Apache) |