V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
oamu
V2EX  ›  MySQL

mysql 5.7 下如何查出按列 a 分组的每一分组按列 b 组内排序的第一条记录的所有记录?想用 row_number() over()写,但是 5.7 好像不支持?

  •  
  •   oamu · Feb 5, 2021 · 2011 views
    This topic created in 1917 days ago, the information mentioned may be changed or developed.
    2 replies    2021-02-05 12:42:52 +08:00
    love2020
        1
    love2020  
       Feb 5, 2021   ❤️ 1
    分组的目的就是模糊单记录而取群体特征。如果可以 max 就行。
    RedBeanIce
        2
    RedBeanIce  
       Feb 5, 2021   ❤️ 1
    group max 两层 select
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3043 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 15:06 · PVG 23:06 · LAX 08:06 · JFK 11:06
    ♥ Do have faith in what you're doing.