当前位置:网站首页>mysql表删除重复值,只保留一个
mysql表删除重复值,只保留一个
2022-04-22 05:22:00 【fxx_pig】
delete a.*
from t as a,
(select * from t group by name having count(1)>1) as b
where a.name=b.name
and a.id>b.id;
count函数是用来统计表中记录数
count(1)和count(*)的区别
1.count(1)和count(*)的作用:
都是检索表中所有记录的行的数目,不论其是否包含null值。
2.区别:但是count(1)比count(*)效率更高
二.count(字段)与count(1)和count(*)的区别
count(字段)的作用是检索表中的这个字段的非空行数,不统计这个字段值为null的记录
版权声明
本文为[fxx_pig]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_44718662/article/details/124279301
边栏推荐
- One click evaluation course script of educational administration management information system
- Basic principle and numerical method of finite element method_ Basic principle of finite element method
- Learning C language diary from scratch -- day27 minesweeping
- Shenzhen Xishuangbanna
- [WPF] use ellipse or rectangle to make circular progress bar
- Basic concepts of outh2
- Multi level cache architecture for 100 million traffic
- Introduction to esmodule specification
- 【WPF】VisualStateManager
- 数据库(二)MySQL表的增删改查(基础)
猜你喜欢
![[C] file operation](/img/fd/ddf94b0ffa743f2288f723a263a045.png)
[C] file operation

Status mode (4.4-4.10)

2022.2.14-2.27 responsibility chain mode

Distributed transaction Seata

One way to disable Google cross domain

MySQL數據庫第十一次作業-視圖的應用

水处理控制系统采用信号隔离器解决因某些现场非电量安装条件的限制问题

Learning C language diary from scratch -- day27 minesweeping

idea2021. 1. When writing SQL in mapper: unable to resolve column / table

Measuring the global recursive DNS infrastructure: a view from the edge
随机推荐
Go语言爬虫基础
基于有限体积法的传热拓扑优化
Enum enumeration type
Delete Xunlei and see the uninstall residue in the folder right-click menu
Database (II) addition, deletion, modification and query of MySQL table (basic)
Measuring the impact of a successful DDoS attack on the customer behavior of managed DNS servi
Access denied for user ‘root‘@‘% mysql在问题(解决)
Learning C language diary from scratch -- day27 minesweeping
Unable to resolve dependency for ': app@debug /compileClasspath': Could not download mapsforge-map. jar
Pyqt5 + yolov5 + MSS to realize a real-time desktop detection software
Temperature control via mqc582tt + PNET
Input and output of scanf and printf (format controller)
Performance
TCP three handshakes and four waves (2022.4.18-4.24)
13.9.1-PointersOnC-20220421
MySQL数据库第十一次
MySQL installation and configuration - detailed tutorial
Measuring the global recursive DNS infrastructure: a view from the edge
Regular expression of shell script
Introduction to esmodule specification