hy....
how to get year now and 10 year before with query
result is 2009,2008,2007,2006,......

thanx..

Recommended Answers

you simply need to use TO_CHAR for the purpose and convert the sysdate to desired format.

Jump to Post

All 3 Replies

you simply need to use TO_CHAR for the purpose and convert the sysdate to desired format.

is there any other option to get the solution?

select to_char( add_months(sysdate, (-12*level)) , 'yyyy') years 
from dual
connect by level <= 10
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.