SELECT * FROM (SELECT * FROM `cmf_users_liverecord` ORDER BY id desc ) test where islive='1' GROUP BY uid ORDER BY id desc;