【发布时间】:2020-05-24 07:22:54
【问题描述】:
我有一个类似于下面的结果表:
如何查询随着时间的推移在 latest_price 和sentiment_change 中都在增加的代码。例如,您可以看到 AMSC 在 latest_price 和 mood_change 中都有所增加。我正在使用 postgresql 感谢您的帮助
"created_at" "ticker" "title" "latest_price" "sentiment_change"
"2020-05-24 06:41:40.948862" "AMSC" "American Superconductor Corporation" "6.66" "5.56"
"2020-05-24 06:42:02.987018" "AMSC" "American Superconductor Corporation" "7.66" "6.56"
"2020-05-24 07:59:08.014871" "AMSC" "American Superconductor Corporation" "8.66" "7.27"
"2020-05-24 08:00:23.406509" "AMSC" "American Superconductor Corporation" "9.66" "8.27"
"2020-05-24 08:04:02.881144" "AMSC" "American Superconductor Corporation" "10.66" "9.27"
"2020-05-24 06:41:51.797114" "AUPH" "Aurinia Pharmaceuticals Inc." "16.24" "-0.37"
"2020-05-24 06:41:52.768141" "CGC" "Canopy Growth Corporation " "19.42" "-0.89"
"2020-05-24 06:42:06.947722" "COF" "Capital One Financial Corp." "60.21" "9.19"
"2020-05-24 07:58:49.696729" "CNC" "Centene Corp." "64.84" "0.0"
"2020-05-24 08:00:05.909404" "CNC" "Centene Corp." "64.84" "0.0"
【问题讨论】:
标签: python sql postgresql window-functions