How I write Select command, that result are all days in this year. I would like use this select as subquery in IN/OUT cursor, therefore I don't want use For..loop. Thanks for answer on my stupid question.
Thank you for replaying me, but your advice isn't answer to my question.
I didn't inquire about condition WHERE, but I'd like to the SELECT return 365 rows, but not only one.
That is an excellent suggestion, Carp. The only thing kludgy about it is the artificial reference to an arbitrary table you know will contain enough rows. It think with a couple changes it will produce a complete answer to Gold2000's question. Try the following:
SELECT trunc(sysdate,'yyyy') - 1 + the_row
FROM (SELECT rownum the_row
FROM dba_objects
WHERE rownum < 367)
where trunc(trunc(sysdate,'yyyy')-1+the_row,'yyyy')
<= sysdate
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.