怎样删除SQL表中相同两行中的一行数据
答案:2 悬赏:50
解决时间 2021-04-28 15:04
- 提问者网友:她是我的お女人
- 2021-04-27 21:32
怎样删除SQL表中相同两行中的一行数据
最佳答案
- 二级知识专家网友:摧毁过往
- 2021-04-27 22:33
select distinct * from tableName
就可以得到无重复记录的结果集。
如果该表需要删除重复的记录(重复记录保留1条),可以按以下方法删除
select distinct * into #Tmp from tableName
drop table tableName
select * into tableName from #Tmp
drop table #Tmp
就可以得到无重复记录的结果集。
如果该表需要删除重复的记录(重复记录保留1条),可以按以下方法删除
select distinct * into #Tmp from tableName
drop table tableName
select * into tableName from #Tmp
drop table #Tmp
全部回答
- 1楼网友:输掉的尊严
- 2021-04-28 00:08
select distinct * into #tmp from tablename
drop table tablename
select * into tablename from #tmp
drop table #tmp
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息