惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
人人都是产品经理
人人都是产品经理
G
GRAHAM CLULEY
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
L
LangChain Blog
AWS News Blog
AWS News Blog
V
Vulnerabilities – Threatpost
博客园 - 司徒正美
Last Week in AI
Last Week in AI
P
Privacy International News Feed
C
CERT Recently Published Vulnerability Notes
Simon Willison's Weblog
Simon Willison's Weblog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Schneier on Security
Y
Y Combinator Blog
月光博客
月光博客
博客园 - Franky
T
Threatpost
Security Latest
Security Latest
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 【当耐特】
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
T
The Exploit Database - CXSecurity.com
A
About on SuperTechFans
I
Intezer
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
Cisco Blogs
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
Know Your Adversary
Know Your Adversary
IT之家
IT之家
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
NISL@THU
NISL@THU
博客园 - 三生石上(FineUI控件)
L
Lohrmann on Cybersecurity
小众软件
小众软件
PCI Perspectives
PCI Perspectives
N
News and Events Feed by Topic
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Engineering at Meta
Engineering at Meta

博客园 - witer666

PHP API 框架开发的学习 [android开发必备] Android开发者社区汇总 android定时器 微博feed系统的push和pull模式和时间分区拉模式架构探讨 redhat安装memcacheQ php empty问题 Linux PHP连接MSSQL Curl参数一览 Redhat Memcache UDF安装配置 Redhat Mongodb学习笔记 PHP使用技巧 位运算符C语言 Redhat Lighttpd安装配置 HTTP 状态代码表示什么意思? PHP正则表达式学习参考的文章 Redhat Cacti安装配置 Percona-Server5.5安装配置 50点提高PHP编程效率 引入缓存提升性能 wget使用
一个mysql小技巧
witer666 · 2012-01-30 · via 博客园 - witer666

mysql> ALTER TABLE `sbear` ADD PRIMARY KEY ( `a_id` , `b_id` ) ;
ERROR 1062 (23000): Duplicate entry ’88-501200′ for key ‘PRIMARY’
建立联合主键时发现出错,88,501200已经早有多条记录了。主键建立失败,需要删除多余的记录,并且有多组这样的重复记录。

这时候使用“ignore”就能将多余的记录删除只保留一条,并且建立联合主键。

mysql> ALTER ignore TABLE `sbear` ADD PRIMARY KEY ( `a_id` , `b_id` ) ;
Query OK, 10824 rows affected (0.15 sec)
Records: 10824 Duplicates: 82 Warnings: 0