1.查询次大记录:
select max(to_number(id))
from ts_organizations
where id not in (select max(to_number(id)) from ts_organizations);
其中ts_organizations为表名,id为排序字段(此字段可能为varchar2()或者char,因此先转换为number类型求最大值);
1.查询次大记录:
select max(to_number(id))
from ts_organizations
where id not in (select max(to_number(id)) from ts_organizations);
其中ts_organizations为表名,id为排序字段(此字段可能为varchar2()或者char,因此先转换为number类型求最大值);