标签:
表中某个指标重复,去掉重复项:
select *
from #temp
where A0107
in (select A0107 from #temp
group by A0107
having COUNT(A0107)>1
) and id not in (
select MIN(id) from #temp
group by A0107
having COUNT(A0107)>1
)
select * from #temp
--实现sql server 中类似于oracle中rownum的关键字,
--我想取出符合条件的第301-310条记录,又不想取出所有数据,有没有好的解决方案?
--插入数据1,2,3,4
select identity(int,1,1) as id,* into #temp from UsrA01
select * from #temp where id between 301 and 310
--1,10插入的数据1,11,21,31,跳十个
select identity(int,1,10) as id,* into #temp1 from UsrA01
select * from #temp1 where id between 301 and 310
标签:
原文地址:http://www.cnblogs.com/beijingstruggle/p/5346733.html