Click here to Skip to main content
14,979,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all.

I need help editing the values in a database table. Its a product subscription table, and i want to write an sql query that will decrease the subscription period by 1 e.g A 12 months subscription will have a value of 12, 6 months will have a value of 6, so I will need help to write a query to reduces all subscription values by 1

I have something like this:

UPDATE TABLE subscription

ADD 1 to sub_period

Kindly reply soon

Thank you

1 solution

Try Update mytable set subscription = subscription - 1
namo77 30-Jun-14 11:56am
Thank you so much!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900