-4

根据这篇文章为什么 MYSQL 更高的 LIMIT 偏移量会减慢查询速度?这篇文章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
4

1 回答 1

0

这应该这样做。(Skip/Take 等于极限)

from u in news
join n in
(
    from x in news
    where x.cat_id = 10
    orderby x.Id descending
    select x
).Skip(10).Take(20) on u.Id equals n.Id
select u
于 2012-09-25T09:50:48.990 回答