Jump to content

Modifing Record without update (basic math)


telsiin

Recommended Posts

Good afternoon to all the Pros

 

I have a table that has numeric data type float on which I perform a simple update on base  on a store ID

 

What I would like to do is instead of doing an Update, is add or subtract a value to the existing value in the table. Example

 

Select * from fruitvendor where storeID='123' and stock='y';

 

Record shows something like this

 

Apple        NY y 20 

Pear          NJ y 20 

Orange        FL y 20 

Cherry        NJ y 20 

Strawberry    FL y 20 

Peach          GA y 20 

Watermelon CA y 20 

Grape        CA y 20 

Pineapple      FL y 20 

Blueberry    FL y 20 

 

I would like to

Add 3 to apple, cherry, watermelon giving me 23.

Add 4 to pear, strawberry, pineapple giving me 24.

Subtract 5 from orange, grape, and blueberry giving me 15

 

Your help and suggestion will greatly appreciated

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.