Incrementing Values SQL?

Hi there, I have got a table using account details
Account(accountID, type, balance, customerID)

i’d like to see to increment all of the accounts simply by 5% where the balance has expired 8000.

Thisis just what exactly ive accomplished.
PICK OUT *
VIA Account
WHERE balance = equilibrium + ( balance * 0.05) AND balance ( CHOOSE *
VIA Account
WHERE balance > 8000 );
Is that this correct

With thanks.

You have to use a good UPDATE search to adjust the beliefs.

You can apply something like this:

REDESIGN Account
FIXED balance = equilibrium * JUST ONE.05
WHERE balance > 8000

Ensure you be cautious, since any mistake may possibly drastically change the info incorrectly.

If you wish to increase the balance value whenever that valuation reaches 8000 that you can do this:

REDESIGN Account SET balance = harmony + (balance * 0.05) WHERE balance > 8000;

ON THE OTHER HAND! You might enhance the balance more than with 5% when you run this query many times.So dependent what you should do you should come up which includes a strategy and that means you don’t boost the balance too much – I know you will not want that.

You have to use a good UPDATE declaration to adjust a row, not any SELECT:

REDESIGN Account
FIXED balance = equilibrium + ( balance * 0.05)
WHERE Add any where terms here;

You must fill in the WHERE clause.It’s simple (it doesn’t need a nested select).

Leave a Reply