select * from tb a where not exists(select 1 from tb where a.c1= c1 and c2<a.c2)
解决方案 »
- 批量随机更新一个字段
- 【请教】为什么局域网内个别机器连不上SQL Server 2005 express
- 怎么判断数据库的最后写入时间?
- 进来看看,急救!!!!在线等
- 急求!! SQL 如何用表2的列的项去替换表1的列的某些项
- 最近要考数据库,小弟对sql语句不是很熟悉,各位大哥大姐,有空的话帮我看一下,顺便解释一下?谢谢了。如果需要我加分,尽可提出。谢谢
- 菜鸟问:SQLServer和MySQL有什么区别、什么联系
- 超奇怪的問題?數值類SUM後,返回的結果還是數據,但為什麼不能計算?
- 如何修改SQL Server 2000的登录模式?
- 跪求大神一个sql
- 新手请教各位高人,多表查询
- 这个sql这样写怎么不对呢?
c1,
min(c1) as c2
from
tb
group by
c1
select c1, min(c2) as c2 from tb group by c1
select c1,c2 from (
select c1,c2,row_number(partition by c1,c2 order by c2) Cnt from C2) T where t.Cnt = 1