Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.