mysql查询结果去重

select * from (select * from t_stb_log where 1=1 and hotelid =355  order by (UNIX_TIMESTAMP(lastonlinetime)-UNIX_TIMESTAMP(logintime))/60  desc ) a group by a.stbnum order by lastonlinetime

你可能感兴趣的:(数据库,mysql)