gpt4 book ai didi

mysql - 在mysql中获取组中的最大值

转载 作者:行者123 更新时间:2023-11-30 22:25:27 26 4
gpt4 key购买 nike

enter image description here

_我怎样才能在每个 anime_id 中获得最高的 episode_id

---这是我想要的输出

    |id  |episode_id |Anime_id
|5 | 2 | 1
|2 | 5 | 2
|8 | 1 | 3
|12 | 4 | 4

最佳答案

按查询简单分组

select anime_id,max(episode_id) as episode_id from episode group by anime_id 

关于mysql - 在mysql中获取组中的最大值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35375967/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com