这3个是查询聊天记录用到的sql语句楼主可以研究一下:
cLoadMessage = 'select d.* from (select a.roomid from mucmemberhistory a, mucmemberhistory b' +
' where a.roomid = b.roomid' +
' and a.jid = ''%S''' +
' and b.jid= ''%S'') c, mucmessage d' +
' where c.roomid = d.roomid order by d.MessageID desc';
cQueryRoomID = 'select a.roomid from mucmemberhistory a, mucmemberhistory b' +
' where a.roomid = b.roomid and a.jid = ''%S'' and b.jid= ''%S'' order by a.roomid desc';
cQueryRoomMessage = 'select * from mucmessage where roomid = ''%S'' order by MessageID desc';
cLoadMessageByRoom = 'select a.creationDate, a.username, a.body, a.html from mucMessage a, ' +
' (select roomId from mucroom where name = ''%S'') b' +
' where a.roomid = b.roomid order by a.MessageID desc'; |