select * from (select * from table_name order by id desc) h where h.catagory_id in(value1,value2,value3) group by h.catagory
可以返回一个结果集,以catagory为标准进行分组,同时保证取到每组里面的最新记录

参考:mysql 分组取最新的一条记录(整条记录)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
  • 2022-12-23
  • 2021-07-29
  • 2021-09-13
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2022-03-03
相关资源
相似解决方案