create table bak as (select * from test group by title having count(*)=1); insert into bak (select * from test group by title having count(*)1); truncate table test; insert into test select * from bak;
数据库的使用过程中由于程序方面的问题有时候会碰到重复数据,重复数据导致了数据库部分设置不能正确设置…… 方法一 : declare @max integer,@id integer declare cur_rows cursor local for select 主字段,count(*) from 表名 group by 主字段 having count(*) 1 open cur_rows fetch cur_rows into @id,@max while fetch_st...
Deleting all data from an Access database Sometimes it may be necessary to delete all the data in a database while retaining the table structure. If done manually, this job can quickly become tedious. If your database has many tables, the following code will clear all the data in a hurry. Dim ctr As Container, d...