Re: date
| От | Ken Hill |
|---|---|
| Тема | Re: date |
| Дата | |
| Msg-id | 1139588221.29808.7.camel@localhost.localdomain обсуждение исходный текст |
| Ответ на | Re: date ("A. Kretschmer" <andreas.kretschmer@schollglas.com>) |
| Ответы |
Re: date
|
| Список | pgsql-sql |
On Fri, 2006-02-10 at 07:38 +0100, A. Kretschmer wrote: <blockquote type="CITE"><pre>
<font color="#000000">am 09.02.2006, um 22:18:09 -0800 mailte superboy143 (sent by Nabble.com) folgendes:</font>
<font color="#000000">> </font>
<font color="#000000">> Hello,</font>
<font color="#000000">> </font>
<font color="#000000">> How can I write an sql query in postgresql so that I can insert a date into</font>
<font color="#000000">> a table in the format DD-MM-YYYY, and when I select the date from the table</font>
<font color="#000000">> I should get the date in the same format.</font>
<font color="#000000">You can't define the format in the db, but you can define the</font>
<font color="#000000">output-format with to_char(date, 'DD-MM-YYYY');</font>
<font color="#000000">HTH, Andreas</font>
</pre></blockquote> You could also try using the data_part() function:<br /><br />
date_part('month',date)||-||date_part('day',date)||-||date_part('year',date)<br/><br /> But I think Andreas' suggestion
isa bit more elegant.<br /><br />
В списке pgsql-sql по дате отправления: