to_date confusion

Поиск
Список
Период
Сортировка
От Richard Rowell
Тема to_date confusion
Дата
Msg-id 1041911915.2836.1.camel@workstation
обсуждение исходный текст
Ответы Re: to_date confusion  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-sql
I'm confused.  How do I get the integer 10102 to come in as the date
2002-01-01?

cmi=> select to_date('010102','MMDDYY'); to_date   
------------2002-01-01
(1 row)

cmi=> select to_char(10102,'000000');to_char 
--------- 010102
(1 row)

cmi=> select to_date(to_char(10102,'000000'),'MMDDYY'); to_date   
------------2010-01-10
(1 row)

TIA!



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

Предыдущее
От: "David Durst"
Дата:
Сообщение: Returning row or rows from function?
Следующее
От: "Daniel Schuchardt"
Дата:
Сообщение: Re: Inherancing