取某列最大值行的字段值
表TB
序号 工时 类型
1 2 A
2 5 A
3 1 A
4 3 A
取工时数最大的行的序号
[解决办法]
- SQL code
select * from tb as t where not exists(select 1 from tb where 类型=t.类型 and 类型>t.类型)
发布时间: 2012-11-04 10:42:42 作者: rapoo
取某列最大值行的字段值
表TB
序号 工时 类型
1 2 A
2 5 A
3 1 A
4 3 A
取工时数最大的行的序号
[解决办法]
select * from tb as t where not exists(select 1 from tb where 类型=t.类型 and 类型>t.类型)