oracle 一条语句:
select sum(serial_mul) from (
select rownum rn, power(10, sum(log(10, rownum))over(order by rownum)) serial_mul,
sum(rownum)over(order by rownum) serial_add
from dual connect by rownum <= 10)
begin
declare @sum int
declare @nj int
declare @n int
set @n=1
set @nj=1
set @sum=0
while @n<=10
begin
select @sum=@sum+@nj
select @n=@n+1
select @nj=@nj*@n
end
end
print @sum