奇怪的现象:

SELECT store_id,store_name,is_update_virtual,store_state,store_sort FROM `sto_store` as `store` WHERE `store`.store_state = '1' order by store_sort asc   limit 0,20;

得出的结果不会优先使用store_sort 字段排序然后默认使用ID升序排序而是无规律的。导致得出的分页结果会重复。

SELECT store_id,store_name,is_update_virtual,store_state,store_sort FROM `sto_store` as `store` WHERE `store`.store_state = '1' order by store_sort asc,store_id asc   limit 0,20;

得出的分页结果是正常的。


相关文章:

  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
  • 2021-01-09
  • 2021-12-16
猜你喜欢
  • 2022-12-23
  • 2021-12-09
  • 2022-01-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
相关资源
相似解决方案