Solved

Add percentage to existing Prices - Non-Zero amounts

Posted on 2009-07-01
3
409 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
3 Comments
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 250 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 31

Assisted Solution

by:awking00
awking00 earned 250 total points
ID: 24757115
See attached.
query.txt
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.

Join & Write a Comment

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now