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!

simple question - increment column value by 1 using query

valatharvMar 6 2009 — edited Mar 6 2009
Hi,

I have a table say "RECORD_COUNT" with columns REC_COUNT(NUMBER) and LOAD_COUNT(NUMBER), table does not uses any sequence.

I simply need an insert query which should increment both the values with +1, example if table have value as 1 for both then insert query should increment both column values by 1, sorry for asking simple question I tried "Insert into RECORD_COUNT (REC_COUNT, LOAD_COUNT) values (REC_COUNTLOAD_COUNT+1,REC_COUNTLOAD_COUNT+1);" but know it is wrong

REC_COUNT LOAD_COUNT
1 1 //CURRENT VALUE

After Insert
REC_COUNT LOAD_COUNT
1 1 //CURRENT VALUE
2 2 //NEW VALUE
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 3 2009
Added on Mar 6 2009
2 comments
3,315 views