interval - doubt

Поиск
Список
Период
Сортировка
От gopal
Тема interval - doubt
Дата
Msg-id 40FB75A5.3030702@ceedees.com
обсуждение исходный текст
Список pgsql-advocacy

In a Table Contains Field
                                            a) fromdate
                                            b) no_of_years

I want get the result from   ==> fromdate's year + no_of_years

EX:
12-05-2004 as fromdate and no_of_years is 2 (like that)
i have the no_of_years in variable manner)

i have tried of

select fromdate, fromdate + interval '2 year' as todate from  table;
(this is working)
but

select fromdate, fromdate + interval no_of_years as todate from  table;
(not is  working)

i need equivalent to prev query

thank u sir
gopal





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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Arrival at OSCON
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: OSCON and cellphone