Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个名为 apps 的表,其中包含 id、type 和 group_id。该表有多个具有相同编号的 group_id。我需要获取类型等于 1 的每个 group_id 编号的最大 id。
我的sql技能不是很好。任何帮助是极大的赞赏
select group_id, max(id) as max_id from apps where type = 1 group by group_id