这是我的sp代码。我想从这个 sp 的结果中选择下一个不同的 6 行。我怎样才能做到这一点?
SELECT N.NewsId,
N.HeadCaption,
(SELECT Name FROM NewsCategory
WHERE NewsCategoryId = N.HeadLineCategoryId) Category,
N.PicUrl,
N.Creation,
SUBSTRING((fnStripTags(N.Description)),1,75) AS ShortDescription
FROM News N
INNER JOIN
(SELECT HeadlineCategoryID, MAX(NewsID) max_id
FROM News
GROUP BY HeadlineCategoryID) N_
ON N.HeadlineCategoryID = N_.HeadlineCategoryID AND
N.NewsID = N_.max_id
ORDER BY N.ViewIndex DESC
LIMIT 6;