七零部落格
思则大道至简,疑则谜团重重!
思则大道至简,疑则谜团重重!
sql用途,查询最近联系人,包括最后的联系时间,最后聊天的内容 用的sqlite 数据库
select * from (select member.uid as uid, member.realname as realname, chat.time as time , chat.content AS content from member LEFT JOIN chat ON (((member.uid = chat.fromuid) and (chat.act ='receive')) or ((member.uid = chat.touid) and (chat.act ='send'))) ORDER BY chat.id asc) group by uid order by time desc