SELECT s.messtitle, s.messcontent, s.sendtime, s.messid, m.readstate FROM eop_ms_messagesinfo s LEFT JOIN eop_ms_userread m ON s.messid = m.messid WHERE s.messid =( SELECT min(s.messid) FROM eop_ms_userread m INNER JOIN eop_ms_messagesinfo s ON s.messid = m.messid WHERE m.msstype = 1 AND m.userid ='UH2404' AND readstate = 1 AND m.messid >5 AND s.messtype IN ("MS03", "MS02", "MS01"))
这是去查询结果中的下一条数据的方法 然后将min换成是max 就是查询下一条数据。
请多指教,我是新手。