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!

tricky sql query... object date created..

khallas301Mar 19 2013 — edited Mar 19 2013
friends...
I'm trying to solve this tricky sql query for sometime but not able to progress when it comes to date....

Q.
Query dba_objects and list all tables created yesterday 'sysdate - 1' and in another column list all tables created 'sysdate - 7'

--below query gives me for yesterday but not sure how to have "Last_week" column populated.. maybe self join?
select owner, object_name, to_char(created, 'MM-DD-YYYY HH24:MI:SS') "Yesterday", to_char(created, 'MM-DD-YYYY HH24:MI:SS') "Last_Week"
from dba_objects
where object_type = 'TABLE'
and created >=trunc(sysdate - 1)
and created < trunc(sysdate)
appreciate your time and efforts in looking this..

thanks

Edited by: khallas301 on Mar 19, 2013 9:27 AM
typo edited.. thanks to frank
This post has been answered by Solomon Yakobson on Mar 19 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 16 2013
Added on Mar 19 2013
3 comments
2,166 views