update radcheck SET radcheck.attribute = 'rejected' where radcheck.username IN (select username from radpostauth where radpostauth.username = $mobile AND radpostauth.authdate < now() - 120)");
当 radpostauth 表中的相同用户名在他的回复列中具有值“拒绝”时,我希望我的查询更新 radcheck 表中用户名的列“属性” 我需要先在 radpostauth.authdate 的基础上更新 radpostauth.reply = 'reject'
最佳答案
请在 mysql 查询中使用连接,因为使用连接而不是内部查询性能更好
update radcheck as rc
JOIN radpostauth asrpa ON (rpa.username = rc.username) AND (rpa.authdate < now() - 120)
SET rc.attribute = 'rejected'
where rpa.reply = 'reject';
关于php - 如何解决下面的查询以及使用 IN 运算符的目的是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37984782/