0

我正在尝试编写一个更新语句,将下多个订单的客户的密码更改为优秀,其中包含所有小写字符:

UPDATE customers_mgs
SET password = 'excellent'
WHERE customer_id = SELECT customer_id FROM customers_mgs WHERE count(>1 group by customer_id)

但我不断收到此错误消息:错误报告 - SQL 错误:ORA-00936:缺少表达式 00936。00000 -“缺少表达式”

4

1 回答 1

1

您需要围绕子查询的括号。据推测,您还想要IN而不是=

UPDATE customers_mgs
    SET password = 'excellent'
    WHERE customer_id IN (SELECT customer_id
                          FROM customers_mgs 
                          GROUP BY customer_id
                          HAVING COUNT(*) > 1
                         );
于 2020-10-26T00:57:44.887 回答