首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
›
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
广告
V2EX
›
MySQL
新手求一个单表无效数据去重的思路
noipnoid
·
2020-04-22 11:17:45 +08:00
· 2213 次点击
这是一个创建于 1627 天前的主题,其中的信息可能已经有所发展或是发生改变。
A 字段跟 B 字段相同,并且记录的 create_time 间隔小于时间 5 分钟的记录,取时间最前的那一条记录
单表
记录
间隔
新手
2 条回复
•
2020-04-22 15:23:36 +08:00
1
xizismile
2020-04-22 14:29:46 +08:00 via Android
sql 去重?整到应用层来处理这个逻辑不香吗?
2
KentY
2020-04-22 15:23:36 +08:00
我 sql-fu 很一般. 但是这个看起来相对容易啊
from Table where a=b and create_ts > "5min ago" order by create_ts limit 1
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
2072 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 26ms ·
UTC 08:27
·
PVG 16:27
·
LAX 01:27
·
JFK 04:27
Developed with
CodeLauncher
♥ Do have faith in what you're doing.