will71110 Posted December 9, 2012 Share Posted December 9, 2012 Hello all, This is my first posting on the forums. Here is my question: I want to reset an entire column to zero monthly. Is the possible using Oracle SQL Express 11g? I looked for a way to do it in the Oracle SQL Developer, but I didn't find away to easily do it there. This is for a school project. One of the columns in the table is called monthly sales. That is the column that I want to reset to zero on the 1st of the month. Thanks in advance if anyone can answer this for me. Link to comment Share on other sites More sharing options...
justsomeguy Posted December 10, 2012 Share Posted December 10, 2012 You can use an update query with no where clause to update every row. UPDATE table SET field=0 Link to comment Share on other sites More sharing options...
will71110 Posted December 10, 2012 Author Share Posted December 10, 2012 Is there away to do this automatically when a new month begins? I was told a trigger could do it, but this trigger would run every time there is an update to the cell. I don't think that is a very good way to accomplish this as it could cause a lot of overhead. Link to comment Share on other sites More sharing options...
justsomeguy Posted December 10, 2012 Share Posted December 10, 2012 A trigger would be the way to do it if you're only using a database. Or else you could use a scheduled task or cron job to run on a schedule and check for things that need to be updated. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now