sql查询分组,排序问题
SELECT c.UserId AS id, u.userimg AS img, u.UserName AS name,
c.CommentContent AS comment, c.CommentTime AS time, c.PostId,
c.MsgType AS mt
FROM tb_Comment c INNER JOIN
tb_User u ON c.UserId = u.UserId
join (select UserId,min(commentTime) minTime from tb_comment group by UserId ) as x
on c.UserId=x.UserId
WHERE (c.PostId = 95)
GROUP BY c.UserId, u.userimg, u.UserName, c.CommentContent, c.CommentTime,
c.PostId, c.MsgType
ORDER BY x.minTime,c.UserId, c.CommentTime