/*删除重复数据,保留一条*/
create table t1(
name VARCHAR(20),
tel varchar(20)
)
/*(插入多次)无字段约束*/
insert into t1 values('张三',60121);
insert into t1 values('李四',60154);
insert into t1 values('王五',60145);
/*执行sql*/
delete from t1 where (name,tel) in
(select name,tel from t1 group by name,tel having count(*)>1)
and rowid not in
(select min(rowid) from t1 group by name,tel having count(*)>1);
结果