开发者

Convert SQL query into CakePHP pagination query

开发者 https://www.devze.com 2022-12-13 00:02 出处:网络
How can I use the following query: SELEC开发者_开发问答T * FROM `laps` WHERE `id` = ( SELECT `id` FROM `laps` AS `alt`

How can I use the following query:

SELEC开发者_开发问答T *
FROM `laps`
WHERE `id` = (
  SELECT `id`
  FROM `laps` AS `alt`
  WHERE `alt`.`user_id` = `laps`.`user_id`
  ORDER BY `lap_time` ASC
  LIMIT 1 )
ORDER BY `lap_time` ASC

in my CakePHP app and paginate the results?


what you actually want is how to do custom pagination query. there's some info about that here


convert your query to join way, then use cake custom pagination.

0

精彩评论

暂无评论...
验证码 换一张
取 消