This works -

  char *stmnt = "UPDATE systab SET sys_state = "
    "(SELECT sys_state FROM systab WHERE item_id = 'NEXT_BATCH_ID') + 1 "
    "WHERE item_id = 'NEXT_BATCH_ID';";

Deepak Kaul wrote:
I have an addition question. Is is possible to increment a value in an update statement? If so how would the sql statement be written?

For example
Table addition with the following columns
unique_id, count

I want something like the following
UPDATE addition SET count = count + 1 WHERE unique_id = 1;

Any help would be greatly appreciated.

Thanks in advance


Reply via email to