Solved

How do I perform mathematical update from fields using select statement

Posted on 2012-03-13
2
338 Views
Last Modified: 2012-03-13
I would like be able to update multiple fields with a mathematical function. For example in this example query I would like each field to be 76% of the original fields value.

select CHARGE from SHCOSTS where COST_CODE='R'and L_WEIGHT < 5.001
which output's


5.490
5.840
5.930
6.070
6.250
5.830
6.220
6.490
6.680
6.770
5.940
6.740
7.080
7.440
7.750
6.200
6.880
7.300
7.780
8.090
6.490
7.260
7.690
8.070
8.390
6.580
7.410
7.900
8.420
8.780
6.690
7.660
8.460
9.060
9.540
20.620
22.900
24.930
27.220
29.590
5.020
5.070
5.100
5.160
5.200
20.620
22.900
24.930
27.220
29.590
5.090
5.140
5.170
5.230
5.290
7.830
8.460
9.940
11.190
12.720
8.070
8.700
10.210
11.800
13.410
14.150
15.400
15.950
17.050
18.150
22.250
23.400
24.600
25.750
26.550
7.830
8.460
9.940
11.190
12.720
8.070
8.700
10.210
11.800
13.410
0
Comment
Question by:elusivedisc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
macarrillo1 earned 500 total points
ID: 37715650
Try:

update SHCOSTS
set CHARGE = CHARGE *0.76
where COST_CODE='R'and L_WEIGHT < 5.001
0
 

Author Closing Comment

by:elusivedisc
ID: 37715873
Worked perfect thank you.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question