举例,我想查出某个表里面符合条件的前5条数据的id 做数据更新 :
想法
报错
更正写法 :
示例:
UPDATE t_authorisation_record ar1
JOIN (
SELECT ID
FROM t_authorisation_record
WHERE device_company_name ='JCccc'
ORDER BY id ASC
LIMIT 5
) ar2 ON ar1.ID = ar2.ID
SET ar1.use_status = 1, order_bill_no='A10101';