select max(RKRQ) RKRQ from ( select top 1000 tb.RKRQ from ZX_GS_FDDBR tb where tb.RKRQ > '2010-09-30 17:41:56.0' order by tb.RKRQ ) b 这句在sybase里不能执行,我想查ZX_GS_FDDBR表中第1000条数据的RKRQ时间 Sybase里怎么才能查出来呢?
这个,似乎只能借助于临时表了
select syb=identity(10), top 1000 * into #tempA from ZX_GS_FDDBR tb where tb.RKRQ > '2010-09-30 17:41:56.0' order by tb.RKRQ
select max(RKRQ) RKRQ from #tempA
drop table #tempA
错,我的是12.5.4可以top
忘了说我的错误提示是说 order by 不让在中间查询语句中执行
An ORDER BY clause is not allowed in a derived table.
Sybase 错误代码=154
Severity Level=15, State=20,Transaction State=1 第2行
错,我的是12.5.4可以top
忘了说我的错误提示是说 order by 不让在中间查询语句中执行
An ORDER BY clause is not allowed in a derived table.
Sybase 错误代码=154
Severity Level=15, State=20,Transaction State=1 第2行
错,我的是12.5.4可以top
忘了说我的错误提示是说 order by 不让在中间查询语句中执行
An ORDER BY clause is not allowed in a derived table.
Sybase 错误代码=154
Severity Level=15, State=20,Transaction State=1 第2行