mapping date value (SQL question)

Поиск
Список
Период
Сортировка
От Johnson, Shaunn
Тема mapping date value (SQL question)
Дата
Msg-id 73309C2FDD95D11192E60008C7B1D5BB0452DFAF@snt452.corp.bcbsm.com
обсуждение исходный текст
Ответы Re: mapping date value (SQL question)
Список pgsql-general

Howdy:

I'm running Postgres 7.1.3 on RedHat Linux 7.2, kernel version
2.4.7 rel 10.

I've created a table which includes the date.  I have been instructed
to map the date into something that reflects the quarter of the year
on the fly (somewhere in the script).  For example:

(currently) date:               (needed) quarter:
2001-02-26                      200101
1998-05-12                      199802
803-11-11                       80304

I was thinking I'd have to use something like a case statement, but
I don't know enough about SQL to do something like that.  Somehow, I
had the notion that if it were possible to write 'if-then-else' loops
I could probably do it.

Is there such a mechanism to do what is being asked of me?

Thanks!

-X

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

Предыдущее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: deleting an identical record
Следующее
От: Darren Ferguson
Дата:
Сообщение: Re: mapping date value (SQL question)