时间:2021-07-01 10:21:17 帮助过:3人阅读
以下是我构造的sql逻辑,mark一下,亲測可行。
SELECT * FROM (SELECT *FROM group_chatmsg_v WHERE ((group_Id=46 AND send_user_id=28 AND receive_user_id=70) OR (group_Id=46 AND receive_user_id=28 AND STATUS=1)) AND is_delete =0 ORDER BY crtime DESC LIMIT 15) AS chatMsgTable ORDER BY crtime ASC
略微复杂的sql逻辑(从数据库逆序查找有限条记录(limit))并按相反顺序输出
标签: