什么是前十条?
select sum(c1) from
( select row_number() over ( order by c1 ) as no,c1 from table1 ) as temp
where no < 11
这样行不?
select sum(c1) from
( select row_number() over ( order by c1 ) as no,c1 from table1 ) as temp
where no < 11
这样行不?
(select top 10 * from table1 order by c1)
select sum(table2.cl) from (select c1 from table1 fetch first 10 rows only)
as table2
As (
select c1 from table1 fetch first 10 rows only )select sum(amount) from AA
第一个:
select col_temp from
(select * from temp ) temp1第二个:
select col_temp from
(select * from temp fetch first 10 rows only ) temp1出错信息为:
SQL0104N 在 "rom (select * from a" 之后发现意外的记号
"fetch"。期望的记号可能包括:")"。 SQLSTATE=42601