PageHelper Custom count (*) query

PageHelpersqlsqlcount;

execute using the paging plug-in, nesting a layer of SELECT COUNT (*) FROM (main sql) tmp_count

SELECT count(*)
FROM (SELECT
        c.company_name,
        c.company_type,
        ...
      FROM company c
        INNER JOIN t_seller ts ON ts.city_site_id = c.city_site_id
        ....
      WHERE c.city_site_id = 1) tmp_count
cout
Mar.02,2021

Why not use the main SQL to pull the data back, and then

  https://github.com/pagehelper.
's latest 5.1.5 has solved this problem. If there is no aggregate function, the condition after select is automatically changed to select count (0) without a layer.

Menu