Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012
    Posts
    488
    Plugin Contributions
    0

    Idea or Suggestion SQL Update Query for featured products? Help

    I am trying to create a script that will remove out of stock items from my featured listings.


    This is the script that I have so far, but I am not a SQL geek, so I am stuck trying to get the multi table/join stuff to work.

    I can do a proper select and get the right data returned, but the update is failing with SQL Syntax errors.

    Can anyone assist?


    UPDATE featured.status
    SET featured.status = '0'
    FROM products Inner Join featured
    ON featured.products_id = products.products_id
    WHERE products.products_quantity = '0' && featured.status = '1'

  2. #2
    Join Date
    Jan 2012
    Posts
    488
    Plugin Contributions
    0

    Default Re: SQL Update Query Help

    Got it sorted.


    UPDATE featured
    Inner Join products
    ON featured.products_id = products.products_id
    SET featured.status = '0'
    WHERE products.products_quantity = '0' and featured.status = '1'

 

 

Similar Threads

  1. 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
  2. v151 Need an SQL query to select a range of products and update the product status to 0
    By oztraveller06 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 8 Mar 2014, 07:33 AM
  3. Bulk change to order status using SQL query for certain products?
    By neo2810 in forum Managing Customers and Orders
    Replies: 3
    Last Post: 24 Feb 2012, 08:34 PM
  4. Mass update product expected dates via SQL query
    By misaki in forum General Questions
    Replies: 3
    Last Post: 22 May 2010, 01:18 AM
  5. Replies: 3
    Last Post: 11 Sep 2007, 05:36 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