- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个表,如下所示:
dpTicker dpDate dpOpen dpHigh dpLow dpClose dpVolume dpAdjClose dpCreated dpModified
GLE.PA 2016-02-01 35.39 35.455 34.375 34.785 2951300 34.785 2016-02-06 13:33:40 2016-02-06 13:33:40
GLE.PA 2016-02-02 34.515 34.565 32.165 32.575 7353600 32.575 2016-02-06 13:33:40 2016-02-06 13:33:40
GLE.PA 2016-02-03 32.4 32.495 30.885 31.6 7007000 31.6 2016-02-06 13:33:40 2016-02-06 13:33:40
GLE.PA 2016-02-04 32.075 32.38 30.67 31.98 8181000 31.98 2016-02-06 13:33:40 2016-02-06 13:33:40
GLE.PA 2016-02-05 32.55 33.0 31.86 32.11 7056700 32.11 2016-02-06 13:33:40 2016-02-06 13:33:40
SELECT
strftime ('%Y-%m', dpDate) AS month,
(SELECT dpOpen
FROM DailyPrices
WHERE dpTicker = 'GLE.PA'
AND dpDate =
(SELECT min(dpDate)
FROM DailyPrices
WHERE strftime('%Y%m', dpDate) = '201509'
)
) AS Open,
max(dpHigh) AS High,
min (dpLow) AS Low,
(SELECT dpClose
FROM DailyPrices
WHERE dpTicker = 'GLE.PA'
AND dpDate =
(SELECT max(dpDate)
FROM DailyPrices
WHERE strftime('%Y%m', dpDate) = '201509'
)
) AS Close
FROM DailyPrices
WHERE dpTicker ='GLE.PA'
AND strftime('%Y%m', dpDate) = '201509';
bash-3.2$ sqlite3 myShares < month.sql
month Open High Low Close
---------- ---------- ---------- ---------- ----------
2015-09 42.72 44.07 37.25 39.85
bash-3.2$
SELECT
strftime('%Y-%m', dpDate) AS Month,
max(dpHigh) AS High,
min(dpLow) AS Low
FROM DailyPrices
WHERE dpTicker ='GLE.PA'
GROUP BY strftime('%Y%m', update);
bash-3.2$ sqlite3 myShares < monthly.sql
Month High Low
---------- ---------- ----------
2000-01 219.32 184.346
2000-02 206.43 181.977
2000-03 210.411 181.503
2000-04 221.405 197.805
2000-05 226.239 55.9199
...
SELECT
strftime('%Y-%m', dpDate) AS Month,
dpOpen AS Open
FROM DailyPrices
WHERE dpTicker = 'GLE.PA'
AND dpDate IN
(SELECT min(dpDate)
FROM DailyPrices
WHERE dpTicker = 'GLE.PA'
GROUP BY strftime('%Y%m', dpDate)
);
bash-3.2$ sqlite3 myShares < Open.sql
Month Open
---------- ----------
2000-01 218.846
2000-02 200.269
2000-03 206.525
2000-04 201.312
2000-05 215.908
...
Month Open High Low Close
------- ----- ----- ----- -----
2015-01 42.79 42.79 33.69 35.18
2015-02 35.39 35.46 26.61 32.42
2015-03 32.32 37.65 31.93 32.48
...
最佳答案
第三个查询指的是在三个位置搜索的特定月份。让我们删除子查询中的两个事件;这需要使用别名,以便我们可以通过名称引用同一表的其他实例:
SELECT
strftime ('%Y-%m', dpDate) AS month,
(SELECT dpOpen
FROM DailyPrices
WHERE dpTicker = 'GLE.PA'
AND dpDate =
(SELECT min(dpDate)
FROM DailyPrices AS DP2
WHERE strftime('%Y%m', DP2.dpDate) = strftime('%Y%m', DP1.dpDate)
)
) AS Open,
max(dpHigh) AS High,
min (dpLow) AS Low,
(SELECT dpClose
FROM DailyPrices
WHERE dpTicker = 'GLE.PA'
AND dpDate =
(SELECT max(dpDate)
FROM DailyPrices AS DP2
WHERE strftime('%Y%m', DP2.dpDate) = strftime('%Y%m', DP1.dpDate)
)
) AS Close
FROM DailyPrices AS DP1
WHERE dpTicker ='GLE.PA'
AND strftime('%Y%m', dpDate) = '201509';
SELECT
strftime ('%Y-%m', dpDate) AS month,
(...) AS Open,
max(dpHigh) AS High,
min (dpLow) AS Low,
(...) AS Close
FROM DailyPrices
WHERE dpTicker ='GLE.PA'
GROUP BY strftime('%Y%m', dpDate);
(SELECT dpOpen
FROM DailyPrices
WHERE dpTicker = 'GLE.PA'
AND ... dpDate ...
ORDER BY dpDate ASC
LIMIT 1) AS Open
关于sqlite - 月度价格数据:开盘价,最高价,最低价和收盘价,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36646800/
我有一个表,如下所示: dpTicker dpDate dpOpen dpHigh dpLow dpClose dpVolume dpAd
我试图在折线图或面积图的工具提示中显示开盘价、最高价、最低价和收盘价。现在,折线图和面积图的数据正在 JSON 数组中发送,如下所示 {timestamp, close} 现在对于 OHLC 或烛台图
假设原始数据是: Timestamp High Low Volume 10:24.22345 100 99 10 10:24.23345 110 97 20 10:24
类似于create an OHLC data from Date, time, price using C# ,如何将基本交易数据转换为 OHLC(或开盘价、最高价、最低价、收盘价)的理论并将其应用于
我有以下格式的连续数据流,我想根据定义的时间片(如 5 分钟、10 分钟、30 分钟等)将其转换为开盘价、最高价、最低价和收盘价。同时 buy_quantity sell_quantity 也应该根据
我正在尝试使用 Convert data to OHLC (Open, High, Low, Close) in JavaScript? 中的脚本将一些图表数据转换为 OHLC。唯一的问题是我的数据与
我有什么 1。我的域“User_Order” CREATE TABLE `user_order` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `cre
我是一名优秀的程序员,十分优秀!