Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
金融価格の時系列があります:
日付価格差異_3 2012年1月1日1,1該当なし 2012年2月1日1,2該当なし 2012年3月1日1,3 2012年4月1日1,3 2012年7月1日1,2 2012年8月1日1.3
過去3回の価格を使用して、各日付の分散を計算する予定です。SQLのみを使用してこれを達成するチャンスはありますか?
ヒントをいただければ幸いです。
select var_pop(price) as variance from ( select price from YourTable order by date desc limit 3 ) as SubQueryAlias