现在的位置: 首页 > 综合 > 正文

Sql语句–删除重复列

2018年04月09日 ⁄ 综合 ⁄ 共 150字 ⁄ 字号 评论关闭

---添加主键

alter table test add  [id] int identity(1,1)

--删除重复列

delete  test where a not in (select top 1 [id] from test group by a,b,c,[id])

--消除主键

alter table test drop column [id]

 

抱歉!评论已关闭.