Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using SQL, need to display previous Year, current year and next year in single variable

1037994Sep 4 2013 — edited Sep 5 2013

Hi All,

We have a requirement to display previous year, current year and next year values as an LOV in ADF page.

This is the query which fetches previous year, current year and next year. But the output of this query will display values in 3 columns:

select (Extract(year from sysdate)-1), Extract(year from sysdate), (Extract(year from sysdate)+1) from dual;

Output:

2012 2013 2014


But I want to display them in single column with 3 rows like:

2012

2013

2014


Please share your ideas.

This post has been answered by Pablolee on Sep 4 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 3 2013
Added on Sep 4 2013
7 comments
2,939 views