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!

Update Query Help

Status
Not open for further replies.

kellan4459

IS-IT--Management
Jul 3, 2003
84
US
I have a table that has product_id, product_price, product_category, product_price_discounted

I want to update the product_price_discounted by multiplying the product_price by .85 for all items where product_category = 1,2,or3

This is new to me so I'm needing some help.
 
I want to update the product_price_discounted by multiplying the product_price by .85 for all items where product_category = 1,2,or3
watch how closely the SQL mirrors what you said ...
Code:
UPDATE daTable
   SET product_price_discounted = product_price * .85 
 WHERE product_category IN ( 1,2,3 )
:)

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top