简体   繁体   中英

How to increase a number by x% in Sqldeveloper

I'm new to sqldeveloper and don't understand how to update a number (that is in a table) by for example 5%.

I tried this:

update column_name set (number = number *1.05);

thanks in advance for telling me the answer,

Ramon

You were close, you just seemed to be missing the table name after the UPDATE statement and then your query should work as expected as the general syntax for updating is as follows:

UPDATE YourTable 
   SET YourColumn = YourPreferredValue

So if your column being targeted was actually number and you wanted to increase it by 105%, then you could use :

UPDATE YourTable 
   SET number = number * 1.05

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM