Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用SQL删除MS Access数据库中的重复行_Sql_Ms Access - Fatal编程技术网

如何使用SQL删除MS Access数据库中的重复行

如何使用SQL删除MS Access数据库中的重复行,sql,ms-access,Sql,Ms Access,我有一个DB,如下所示: Event ID Date Season 001 03/11/2014 1 001 03/11/2014 1 002 10/11/2014 2 002 10/11/2014 2 001 07/07/2015 3 期望输出: Event ID Date Season

我有一个DB,如下所示:

Event ID       Date         Season
  001       03/11/2014        1
  001       03/11/2014        1
  002       10/11/2014        2
  002       10/11/2014        2
  001       07/07/2015        3
期望输出:

Event ID       Date         Season
  001       03/11/2014        1
  002       10/11/2014        2
  001       07/07/2015        3

是否可以在MS Access中使用SQL来达到此目的?

也许最简单的方法是使用临时表,删除所有行,然后重新插入:

select distinct t.*
into temp_t
from t;

delete * from t;

insert into t
    select *
    from temp_t;