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
noipnoid
V2EX  ›  MySQL

新手求一个单表无效数据去重的思路

  •  
  •   noipnoid · Apr 22, 2020 · 2630 views
    This topic created in 2196 days ago, the information mentioned may be changed or developed.
    A 字段跟 B 字段相同,并且记录的 create_time 间隔小于时间 5 分钟的记录,取时间最前的那一条记录
    2 replies    2020-04-22 15:23:36 +08:00
    xizismile
        1
    xizismile  
       Apr 22, 2020 via Android
    sql 去重?整到应用层来处理这个逻辑不香吗?
    KentY
        2
    KentY  
       Apr 22, 2020
    我 sql-fu 很一般. 但是这个看起来相对容易啊

    from Table where a=b and create_ts > "5min ago" order by create_ts limit 1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5645 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 08:29 · PVG 16:29 · LAX 01:29 · JFK 04:29
    ♥ Do have faith in what you're doing.