どのように私はmysqlのクエリで列の間に取得することができます

StackOverflow https://stackoverflow.com/questions/2202843

  •  18-09-2019
  •  | 
  •  

質問

私はデータベースによると、中間の行をフェッチします。

私は制限を使用します最後の10行について同様

    return Doctrine_Query::create()
                ->select('v.*')
                ->from('Video v')                   
                ->where("v.community_id='$community_id' AND v.user_id='$user_id' AND v.published='$published'")
                ->orderBy('v.id DESC')
                ->limit(10)
                ->execute();        

しかし、私は110〜120行をしたい場合は?誰がそのことについて教えてもらえますか?教義にクエリのこの種の記述方法

役に立ちましたか?

解決 4

オフセット句を使用して... <のhref = "http://www.doctrine-project.org/documentation/manual/1_1/en/dql-doctrine-query-language:limit-and-offset-clauses" rel = "nofollowをnoreferrer"> CHK DIS の

他のヒント

<のhref = "http://www.doctrine-project.org/documentation/manual/1_2/en/dql-doctrine-query-language:limit-and-offset-clauses" のrel = "nofollowをを使用しますnoreferrer ">オフセット()の句ます。

は、<全角> の<のhref = "http://www.doctrine-project.org/documentation/manual/1_2/en/utilities:pagination#working-with-pager" のrelを使用することができます= "nofollowをnoreferrer"> Doctrine_Pager

$page = 10;
$limit = 10;
$query = Doctrine_Query::create()
        ->select('t.*')
        ->from('SomeTable t')

$pager = new Doctrine_Pager(
    $query,
    $page,
    $limit
);

$rows = $pager->execute();

行110-120のために、あなたがしたい。

LIMIT 109, 10
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top