Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help With a Query 1

Status
Not open for further replies.

Nvisible

Technical User
Dec 30, 2009
2
CA
I have a custom store built that has a ton of product in it.

I need to change prices by 5% and have been told I can do a query in the database to do this.

I have ran query before but nothing I have wrote myself. I just don't know how to write that kind of stuff.

I have 14 tables in my database the table the holds the prices is called

flex_product

Inside that table are the following values.

id
category_id
item-no
name
size
price
image
pdf_image
status

So I need to change the price value by 5% (prices going down by 5%) The prices are in regular us decimal fund ie. 4.31

Any one got a clue how to do this or can point me in the right direction

Thanks.

 
Something simple like:

Code:
UPDATE flex_product set price=price + (price*0.05);

Test it on sample data before running it on your live table just to be safe.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Worked like a charm except it went up 5% instead of down but I am smart enough to figure out a + vs a -

Thanks much appreciated
 
Oops yes my mistake. should be -, sorry about that.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top