如何使用1274147184格式的“lastOnline”列从我的数据库中获取过去30天内登录的成员数?
答案 0 :(得分:1)
select
count(*) as users
from table
where from_unixtime(lastonline) >= now() - interval 30 day
答案 1 :(得分:0)
SELECT * FROM table WHERE lastOnline > (UNIX_TIMESTAMP(NOW()) - (3600*24*30));