Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Add percentage to existing Prices - Non-Zero amounts

Posted on 2009-07-01
3
Medium Priority
?
418 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
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…
Suggested Courses

650 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