MySQL插入错误代码:1093。您不能在FROM子句中指定目标表'client_requests'进行更新

时间:2019-04-11 07:25:34

标签: mysql

尝试将数据插入表时出现此错误。这是我的查询

INSERT INTO client_requests(client_price_plan_id, request) VALUES
(
(SELECT @client_price_client_price_plans.id FROM client_price_plans 
WHERE client_id = 1),
(SELECT COUNT(client_requests.id) FROM client_requests 
JOIN client_price_plans
ON client_price_plans.client_id = 1
)+1
)

我的错在哪里。请帮助我

1 个答案:

答案 0 :(得分:3)

FROM client_requests更改为FROM client_requests c