PrivateUser
PrivateUser

Reputation: 4524

#1064 Syntax Error : In "Update Query"

When I use this mysql code

update catalog_product_entity_decimal
  set value = "6.0000" 
  where attribute_id = 75 and
        entity_in ( SELECT 
        product_id 
        from `catalog_category_product` 
        WHERE category_id =37 );

i'm getting this error

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT product_id from `catalog_category_product` ' at line 4

I couldn't figure out what's wrong with my query. Can someone tell me what's wrong?

Thank you

Upvotes: 0

Views: 80

Answers (3)

rakeshjain
rakeshjain

Reputation: 1761

You are missing the IN clause after entity_in. Use this:

update catalog_product_entity_decimal
  set value = "6.0000" 
  where attribute_id = 75 and
        entity_id IN ( SELECT 
        product_id 
        from `catalog_category_product` 
        WHERE category_id =37 );

Upvotes: 3

Bindiya Patoliya
Bindiya Patoliya

Reputation: 2764

You missed = OR in in the query

Upvotes: 1

user2737522
user2737522

Reputation:

I think catalog_category_product will not contain the ' symbol. Try the query without using the ' symbol

Upvotes: 1

Related Questions