美好的一天。
我遇到了MySql
删除查询。
基本上我需要删除此SELECT
查询的结果:
SELECT radcheck.* FROM
(SELECT
permanent_users.realm,
devices.name,
devices.created,
TimeDiff(Now(), devices.created) AS TimeDifference
FROM
permanent_users
INNER JOIN devices ON devices.permanent_user_id = permanent_users.id
WHERE
TimeDiff(Now(), devices.created) > '01:30') MySubQuery
INNER JOIN radcheck ON MySubQuery.name = radcheck.username
任何帮助都会有很大帮助!
谢谢
答案 0 :(得分:0)
应该是
delete radcheck from radcheck
inner join (SELECT
permanent_users.realm,
devices.name,
devices.created,
TimeDiff(Now(), devices.created) AS TimeDifference
FROM
permanent_users
INNER JOIN devices ON devices.permanent_user_id = permanent_users.id
WHERE
TimeDiff(Now(), devices.created) > '01:30') MySubQuery on MySubQuery.name = radcheck.username
答案 1 :(得分:0)
继续阅读scaisEdge的提示,这是有效的
谢谢!!
delete radcheck from radcheck
inner join (SELECT
permanent_users.realm,
devices.name,
devices.created,
TimeDiff(Now(), devices.created) AS TimeDifference
FROM
permanent_users
INNER JOIN devices ON devices.permanent_user_id = permanent_users.id
WHERE
TimeDiff(Now(), devices.created) > '00:05') MySubQuery on MySubQuery.name = radcheck.username;