mysql查询
warning:
这篇文章距离上次修改已过605天,其中的内容可能已经有所变动。
-- create table student(id int,name varchar(20),cource varchar(30),grade int);
-- insert into student value(2,'王五','English',100);
-- select * from student;
-- use test;
#查询所有name字段重复值
-- select * from student where name in (select name from student group by name having count(name)>1) order by grade desc;
#查询所有name字段重复值中id最小的
-- select * from student where name in(select name from student group by name having count(name)>1) and id in(select min(id) from student group by name having count(name)>1);
-- SET SQL_SAFE_UPDATES = 0;
-- delete from student where name in (select t.name from(select name from student group by name having count(name)>1) t) and id in (select dt.min_id from (select min(id) as min_id from student group by name having count(name)>1) dt);
叼茂SEO.bfbikes.com
叼茂SEO.bfbikes.com
叼茂SEO.bfbikes.com
看的我热血沸腾啊https://www.jiwenlaw.com/
怎么收藏这篇文章?
不错不错,我喜欢看 https://www.237fa.com/
看的我热血沸腾啊https://www.ea55.com/
真棒!