select identity(int,1,1) as id ,* into #t from t
select fd1,fd2,fd3,fd4 from #t a,
(select min(id) from #t group by fld1,fld2) b
where a.id=b.id
drop table #t
select fd1,fd2,fd3,fd4 from #t a,
(select min(id) from #t group by fld1,fld2) b
where a.id=b.id
drop table #t
解决方案 »
- 关于字符串的问题。急,在线等待
- 如何匹配進出記錄啊?請大俠們指教啦!! (在線等)
- 出错。。。。。。。。。。。。。。。。。。。
- C# txt文件导入SQL数据表
- SQL语句这是什么意思 tempdb..sysobjects
- 存储过程返回值,散分了!
- 十万火急 快救我吧
- 怎样用一条SQL语句求出记录集中某N条记录中的某个字段有重复值!!
- 如果要找份好工作,大型数据库应该学什么?oracle、sql server?db2?informix?
- 问一个很菜很丢人的问题,database profile是什么意思?
- 如何取两个字段内容都一样的字段并分开显示阿???
- 恐怖之极:SQL SERVER使用的内存怎么越来越大
select fd1,fd2,fd3,fd4 into #t1 from #t a,
(select min(id) from #t group by fld1,fld2) b
where a.id=b.id
truncate table t
insert into t select * from #t1
drop table #t
drop table #t1