Solved

Add percentage to existing Prices - Non-Zero amounts

Posted on 2009-07-01
3
412 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 32

Assisted Solution

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

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

774 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