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!

Selecting Rows for a date based on SYSDATE help

504701Dec 5 2007 — edited Dec 6 2007
Hey Guys,

I am attempting to target a particular day in order to update a table i have from another much larger table. I would like to only update the smaller table once a day with only the previous days stats.

The query i have below does not work, and i have been wrecking my head with it, so i thought i would see what the professionals thought.
Select 
to_char(logtime,DD-MM-YYYY'),
COUNT(X),
COUNT(Y),
COUNT(Z)
from mytable
where logtime = sysdate-1
group by to_char(logtime,DD-MM-YYYY')
These are the results:
04-DEC-07 3 3 0

The actual results should be in the 100k's

Any help as always greatly appreciated.
Robert
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2008
Added on Dec 5 2007
18 comments
846 views