Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Help with SQL query

    Hi everyone,

    I have a client who needs to change the prices of about 500 products. All of the products are currently $3.50 and they need to be changed to $4.50. All of the products are listed under one manufacturer. They do not want to change the prices of products from any other manufacturer. Is there an SQL query that they can run to change the price of all products from one manufacturer at one time?

    I have this so far:
    UPDATE products SET products_price=4.50 where products_price=3.50;
    But the problem is it is not limited to a specific manufacturer, so it will change the price of ALL products that are currently $3.50. I'm not sure what I need to add to make it work...

    Can anyone help?

    Thank you!
    Danielle

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Help with SQL query

    If you know the manufacturers_id for that manufacturer, you can specify that in your WHERE clause as well.

    ie:

    AND manufacturers_id = 2
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2006
    Posts
    656
    Plugin Contributions
    0

    Default Re: Help with SQL query

    What about a query to increase all of your prices (for the entire cart) by a certain percentage? Say you wanted ALL the prices to go up by, 10% for example? Or 9% or 21%, whatever percentage you needed.
    I Think, Therefore I Zen. I Zen, Therefore, I AM!
    Personalized Flowers!
    Flowertown Speaking Roses
    using version 1.5.7-06232020

  4. #4
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Help with SQL query

    Quote Originally Posted by wtashby View Post
    What about a query to increase all of your prices (for the entire cart) by a certain percentage? Say you wanted ALL the prices to go up by, 10% for example? Or 9% or 21%, whatever percentage you needed.
    http://www.zen-cart.com/forum/showth...d=1#post490420
    Previous thread above should help

 

 

Similar Threads

  1. Replies: 9
    Last Post: 12 Jul 2023, 12:26 AM
  2. v154 Help with a SQL Query for Query Builder
    By lindasdd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 24 Mar 2016, 01:18 PM
  3. Need help with SQL query. Want to make membership that expires.
    By TecBrat in forum Managing Customers and Orders
    Replies: 1
    Last Post: 18 Jun 2010, 03:43 PM
  4. Help with a sql query
    By batteryman in forum General Questions
    Replies: 21
    Last Post: 3 Oct 2008, 11:12 PM
  5. Help with SQL query returning multiple rows
    By acetate in forum General Questions
    Replies: 3
    Last Post: 9 Mar 2008, 03:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg