select * from table where id not in (select max(id) from table group by col1,col2,col3........)ID为表任何具有唯一性的值。
解决方案 »
- 复杂的SQL查询, 请高手指点
- sql报错。不知如何改啊。消息 8156,级别 16,状态 1,第 28 行
- sql 2000实现row_number()over(partition by nember order by sl DESC)的方法
- 字段属性为datetime的日期可以比较大小吗?
- 请高手帮我看看这个SQL语句该怎么写?
- 大型数据系统的行号的问题
- 大家好,帮我看看这个问题,多谢!
- 下列语句是否能指定列:EXEC master..xp_cmdshell 'bcp 库名.dbo.表名out c:\Temp.xls -c -q -S"servername" -U"sa" -P""'
- 请教高手!!
- 为何我的sqlserver挂接不上
- about Trigger for delete
- SQLSERVER中如何转换时间戳?
select * from #temp where id not in (select max(id) from table group by col1,col2,col3........)
select distinct 字段1 from table group by 字段1 having count(字段1)>1