avatar
a problem, thank you# Database - 数据库
a*z
1
How to query stock price table (price in double) and return the the top 10%
of the highest percent return?
Thanks.
avatar
e*g
2
俺菜鸟,不是可以Desc 排序吗?

%

【在 a*z 的大作中提到】
: How to query stock price table (price in double) and return the the top 10%
: of the highest percent return?
: Thanks.

avatar
a*z
3
percent return needs to be calc'ed, but not allowed to write function.
avatar
e*g
4
你调用sql的程序不能算吗?还是说数据库一般都不这么用的?
俺是外行

【在 a*z 的大作中提到】
: percent return needs to be calc'ed, but not allowed to write function.
avatar
B*g
5
啥db。
啥version。
其实不用看了,google "over() partition by"

%

【在 a*z 的大作中提到】
: How to query stock price table (price in double) and return the the top 10%
: of the highest percent return?
: Thanks.

avatar
a*z
6
Thank you all for your info.
date price
1 12
2 23
3 10
...
I was asked to query the table in SQL 2005 to get the top 10% of performance
{(price - prior price)/price} without defining function. Thank you again.
avatar
B*g
7
sql server 呀
SELECT TOP(10) PERCENT 。。。。。。。

performance

【在 a*z 的大作中提到】
: Thank you all for your info.
: date price
: 1 12
: 2 23
: 3 10
: ...
: I was asked to query the table in SQL 2005 to get the top 10% of performance
: {(price - prior price)/price} without defining function. Thank you again.

avatar
a*z
8
yes, I thought that.
select top 10 percent (price - lag(price))/price pctChange
from ....
order by pctChange
that pctChange needs to be calc'ed from price with 1 period lag. I do not
know if it works.
Thank you very much.
avatar
c*e
9
qualify with rank/row_number() etc

%

【在 a*z 的大作中提到】
: How to query stock price table (price in double) and return the the top 10%
: of the highest percent return?
: Thanks.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。