以下语句的前提是ID为主键(不重复)的情况下

select  max(id),pid,fid,cname,state,redate,tname
from table group by pid,fid,cname,state,redate,tname


如果只需要PID相同的去掉一项,可改为 select * from  table where id in (select  max(id) as id group by pid
)

相关文章:

  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-18
  • 2022-12-23
  • 2021-11-18
  • 2021-11-08
  • 2021-06-13
  • 2022-12-23
  • 2021-06-16
相关资源
相似解决方案