Viet Hoang
06/04/2020, 7:35 AMlimit
and offset
is applied in 1 query, you have to use a window function:
SELECT foo
, count(*) OVER() AS full_count
FROM bar
WHERE <some condition>
ORDER BY <some col>
LIMIT <pagesize>
OFFSET <offset>;
or in case of MySQL, the FOUND_ROWS feature:
SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE id > 100 LIMIT 10;
SELECT FOUND_ROWS();
Is there a way to achieve the same thing with Exposed ?spand
06/04/2020, 10:35 AMCustomFunction
but obviously that will be dialect specificDougy
06/27/2020, 11:56 PMspand
06/29/2020, 5:09 AMDougy
07/03/2020, 12:15 PM