0

如果我运行此查询,则会收到错误消息:

我做错了什么?

询问:

UPDATE cscart_profile_fields.value
SET    cscart_profile_fields_data.value = '0'
FROM   cscart_profile_fields_data
   INNER JOIN cscart_user_profiles
     ON cscart_profile_fields_data.object_id =  cscart_user_profiles.profile_id
WHERE  
where  cscart_user_profiles.user_id = 5316 and
(
cscart_profile_fields_data.field_id = 65
or
cscart_profile_fields_data.field_id = 66)

错误:

#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 'FROM cscart_profile_fields_data INNER JOIN cscart_user_profiles ' at line 3
4

1 回答 1

2

尝试这个:::

UPDATE cscart_profile_fields_data
       INNER JOIN cscart_user_profiles
     ON cscart_profile_fields_data.object_id =  cscart_user_profiles.profile_id
SET    cscart_profile_fields_data.value = '0'

where  cscart_user_profiles.user_id = 5316 and
(
cscart_profile_fields_data.field_id = 65
or
cscart_profile_fields_data.field_id = 66)
于 2013-10-24T11:53:36.567 回答