?
Solved

Add percentage to existing Prices - Non-Zero amounts

Posted on 2009-07-01
3
Medium Priority
?
417 Views
Last Modified: 2012-05-07
Hi,

This is a follow up question to my previous one. I'm using PHPmyAdmin for changes to the field below.

How do I add 10% to 3,000 Fields called 'price' (Table Name = 'ss_products') where the field is not = zero?

I'm a newb at mySQL, so please include a working answer.

Thanks.
0
Comment
Question by:tvtech
[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
3 Comments
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 1000 total points
ID: 24753296
As allways when doing UPDATES, make a backup first (or run on test table):
# backup:
CREATE TABLE ss_products_backup SELECT * FROM ss_products 
 
# update prices
UPDATE ss_products SET price = price + price/10

Open in new window

0
 
LVL 32

Assisted Solution

by:awking00
awking00 earned 1000 total points
ID: 24757115
See attached.
query.txt
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

770 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