Обсуждение: interval - doubt

Поиск
Список
Период
Сортировка

interval - doubt

От
gopal
Дата:

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