access 删除重复数据的sql语句

DELETE id  FROM 表1  WHERE id not in (select min(id) from 表1 group by title)

删除title 重复的

SQL语句where id in 排序按in的顺序显示

Access:

select * From 表 Where id in(1,5,3) order by instr(',1,5,3,',','&id&',')

MSSQL:

select * From 表 Where id in(1,5,3) order by charindex(','+rtrim(cast(id as varchar(10)))+',',',1,5,3,')

More...

去除数据库中重复的数据(sql语句)

SQL语句如下:

DELETE FROM T_S_POS_SHOPRECODE A
    WHERE (A.POSID, A.SHOPTIME, A.CARDID) IN
    (
     SELECT POSID, SHOPTIME, CARDID
     FROM T_S_POS_SHOPRECODE

More...