根据这篇文章Why does MYSQL higher LIMIT offset slow the query down?和本文http://explainextended.com/2009/10/23/mysql-order-by-limit-performance-late-row-lookups/我需要一个linq来创建以下查询
SELECT news.*
FROM (
SELECT id
FROM news
WHERE cat_id= x
ORDER BY
id DESC
LIMIT m, n
) o
JOIN news
ON news.id = o.id
答案 0 :(得分:0)
好的,我试过......
var res =
from item in
(from newsItem in news
where newsItem.cat_id = x
select newsItem.id).Skip(m).Take(n)
join other in news
on other.id equals item.id
select item