Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7774967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:30:40+00:00 2026-06-01T17:30:40+00:00

My script-: UPDATE catalog_product_price SET catalog_product_price.value = 200 WHERE value_id = ( SELECT value_id

  • 0

My script-:

UPDATE catalog_product_price 
SET catalog_product_price.value = 200
WHERE value_id = (
    SELECT value_id
    FROM catalog_product_price
    WHERE `entity_id` = ( 
        SELECT `entity_id` 
        FROM `catalog_product_entity` 
        WHERE `sku` LIKE 'sample'
        ) 
    AND website_id = 10
    AND customer_group_id= (
        SELECT customer_group_id
        FROM customer_group
        WHERE 
            customer_group_id = catalog_product_price.customer_group_id 
            AND customer_group_code =100
        )
    )

It gives me following error-:

#1093 – You can’t specify target table ‘catalog_product_price’ for update in FROM clause

Can anybody provide me solution for the same as I tried solution given on this link-:
http://www.mysqlfaqs.net/mysql-faqs/Errors/1093-You-can-not-specify-target-table-comments-for-update-in-FROM-clause
but unable to do…
Please help me..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:30:41+00:00Added an answer on June 1, 2026 at 5:30 pm

    You need to join tables to the UPDATE statement instead of using all of those subqueries

    UPDATE  catalog_product_price cpp
    
    JOIN    catalog_product_entity cpe
      ON    cpe.entity_id = cpp.entity_id
      AND   cpe.sku LIKE 'sample'
      AND   website_id = 10
    
    JOIN    customer_group cg
      ON    cg.customer_group_id = cpp.customer_group_id
      AND   cg.customer_group_code = 100
    
    SET cpp.value = 200
    

    note: Your syntax is quite difficult to read so I may have made a mistake interpreting it. Anyway, this is the idea and it should help you get to the final answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble. Instead of launchin script UPDATE table_name SET field=value WHERE id=12345 I
hi i run this script UPDATE t1 SET T1.col1= T2.col1 FROM aaa t1 ,
Can I modify the mysql syntax SET more of a sample script: UPDATE login
I have a 500,000 line SQL script: UPDATE users SET region_id = 9814746 WHERE
I'm having some issues using mysqli to execute a script with SELECT,DELETE,INSERT and UPDATE
I run sudo svn --username radek update .$codebase. --force; from my php script (on
Let's say I have some update script: update sometable set somecolumn = 'somevalue' where
I would like a PHP script to read the contents from a CSV file
I'd like to trigger a script to update some statistics when a user submits
The following script will update the database, but it won't display the correct page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.