select distinct为什么删除不了重复值
我从智联招聘找了382条数据,
为什么我用Navicat写以下,可以得到379条数据:
select * from abc;
start transaction;
create table abc_new select distinct * from abc;
delete from abc;
insert into abc select * from abc_new;
drop table abc_new;
commit;
而这样写还是得到382条数据:
select * from abc;
start transaction;
select distinct * from abc;
commit;
或者这样写也是得到382条数据:
select * from abc;
start transaction;
create table abc_new select distinct * from abc;
commit;
请问我select distinct用法哪里错了?谢谢
为什么我用Navicat写以下,可以得到379条数据:
select * from abc;
start transaction;
create table abc_new select distinct * from abc;
delete from abc;
insert into abc select * from abc_new;
drop table abc_new;
commit;
而这样写还是得到382条数据:
select * from abc;
start transaction;
select distinct * from abc;
commit;
或者这样写也是得到382条数据:
select * from abc;
start transaction;
create table abc_new select distinct * from abc;
commit;
请问我select distinct用法哪里错了?谢谢
...全文
相关推荐
SQL SELECT DISTINCT 语句
SQL SELECT DISTINCT 语句 SELECT DISTINCT 语句用于返回唯一不同的值。 SQL SELECT DISTINCT 语句 在表中,一个列可能会包含多个重复值,有时您也许希望仅仅列出不同(distinct)的值。 DISTINCT 关键词用于返回唯一不同的值。 SQL SELECT DISTINCT 语法 SELECT DISTINCT column_name,column_name FROM table_name; 在本教程中,我们将使用 RUNOOB 样本数据库。 下面是选自 “Websites” 表的数据: +----+--------------+-
select distinct用法
sql中select语句中的distinct的用法
SQL select distinct的使用方法
主要介绍了SQL中distinct的用法 ,需要的朋友可以参考下
mysql中distinct用法【SQL中distinct的用法】.docx
mysql中distinct用法【SQL中distinct的用法】.docx
sqlserver中distinct的用法(不重复的记录)
distinct这个关键字用来过滤掉多余的重复记录只保留一条,但往往只用它来返回不重复记录的条数,而不是用它来返回不重记录的所有值。其原因是distinct只有用二重循环查询来解决,而这样对于一个数据量非常大的站来说,无疑是会直接影响到效率的。


