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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea59d6-1d73.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea59d6-1d73.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?