Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2012
    Posts
    27
    Plugin Contributions
    0

    Default SQL Query Load data into column

    Hi

    In the product_attributes table I want to add "1" into the attributes_price_factor column but only when the value of options_values_id column is "39" using an SQL query. I have googled this but can't find exactly what I am looking for.

    Could anybody help me on this please.

    Thanks

    Mike

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: SQL Query Load data into column

    Is it add 1 or set as 1?

    Is it that you are wanting to UPDATE the existing data or do you want to do this when items are INSERTed?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Feb 2012
    Posts
    27
    Plugin Contributions
    0

    Default Re: SQL Query Load data into column

    Hi

    I have about 1000 items where I want to add the price offset of "1.000" and rather than do each one separately I thought it would be easier to update/insert with an SQL query

    Thanks

    Mike

  4. #4
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: SQL Query Load data into column

    Quote Originally Posted by mike14017 View Post
    Hi

    I have about 1000 items where I want to add the price offset of "1.000" and rather than do each one separately I thought it would be easier to update/insert with an SQL query

    Thanks

    Mike
    To increase the price offset by 1.000:
    In the install sql updates window of the admn enter:

    Code:
    Update products_attributes set attributes_price_factor=attributes_price_factor+1 where options_values_id = 39;
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Feb 2012
    Posts
    27
    Plugin Contributions
    0

    Default Re: SQL Query Load data into column

    Hi

    Worked like a charm. Thank you so much I really appreciate it.

    Mike

  6. #6
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: SQL Query Load data into column

    Quote Originally Posted by mike14017 View Post
    Hi

    Worked like a charm. Thank you so much I really appreciate it.

    Mike
    Welcome, glad it worked out and maybe you were able to figure out how to do something similar in the future. :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

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. v151 SQL query setup. How do I TEST a query 'off-line'?
    By lewisasding in forum General Questions
    Replies: 3
    Last Post: 8 Mar 2013, 12:24 AM
  4. Replies: 2
    Last Post: 15 Aug 2011, 04:58 AM
  5. Replies: 0
    Last Post: 27 Jul 2009, 07:07 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR