DELETE FROM banned_users WHERE datetime < (NOW() - INTERVAL $ban MINUTE)
我目前正在使用上述内容仅删除禁令解除的帐户,但是我可以将语句更改为不删除'ban_length'中的项目!=“INF”
答案 0 :(得分:1)
假设您没有其他要求,那么这应该可以解决问题:
DELETE FROM banned_users WHERE ban_length != 'INF' && datetime < (NOW() - INTERVAL $ban MINUTE)
答案 1 :(得分:0)
DELETE FROM banned_users WHERE datetime < (NOW() - INTERVAL $ban MINUTE) && ban_length != 'INF'
答案 2 :(得分:0)
不删除ban_length != 'INF'
的项目?因此,仅在ban_length = 'INF'
?
DELETE FROM banned_users
WHERE datetime < (NOW() - INTERVAL $ban MINUTE)
AND ban_length = 'INF';
答案 3 :(得分:0)
5.1.24之后,mysql为INF,INF和NaN提供NULL。如果你使用的是大于5.1.24的mysql,你可以试试这个:
DELETE FROM banned_users WHERE datetime < (NOW() - INTERVAL $ban MINUTE) AND ban_length=NULL
或者,您可以尝试:
DELETE FROM banned_users WHERE datetime < (NOW() - INTERVAL $ban MINUTE) AND ban_length=INF