查看“︁MySQL/GROUP BY”︁的源代码
来自康健生活
←
MySQL/GROUP BY
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 标题文字 == 场景是根据团队id和用户id进行排序,然后取其中团队id和用户id相同但create_at时间最大的条目。 <syntaxhighlight lang="mysql"> SELECT MAX(tmp.create_at) AS create_at, tmp.team_id, tmp._user_id FROM ( SELECT thf.team_id AS team_id, thf.user_id AS user_id, thf.message -> '$.user' AS _user_id, thf.create_at AS create_at FROM md_team_history thf WHERE thf.message -> '$.user' IS NOT NULL ) AS tmp GROUP BY tmp.team_id, tmp._user_id ORDER BY tmp.team_id, tmp._user_id</syntaxhighlight>
返回
MySQL/GROUP BY
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。