-1

可能重复:
需要一个 linq 来生成自己加入

根据这篇文章为什么 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

好吧我试过了...

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
于 2012-09-25T15:04:26.317 回答