I have a table like this. i want to find a one line result for each coin. in this example like BTC,%age change, up or down Can anyone have a better query? the one i have made is very very very slow ;) +-----------+-------------+-----------------+---------------------+------------+ | coin_name | coin_symbol | coin_usdt_price | created | timestamp | +-----------+-------------+-----------------+---------------------+------------+ | Bitcoin | BTC | 58975.26000000 | 2021-03-18 03:07:52 | 1616036872 | | Bitcoin | BTC | 58884.50000000 | 2021-03-18 03:09:41 | 1616036981 | | Bitcoin | BTC | 58775.18000000 | 2021-03-18 03:19:50 | 1616037590 | | Bitcoin | BTC | 58825.62000000 | 2021-03-18 03:21:16 | 1616037676 | | Bitcoin | BTC | 58740.77000000 | 2021-03-18 03:52:03 | 1616039523 | | Bitcoin | BTC | 58730.95000000 | 2021-03-18 03:52:14 | 1616039534 | | Bitcoin | BTC | 58698.49000000 | 2021-03-18 03:53:57 | 1616039637 | | Ethereum | ETH | 1843.19000000 | 2021-03-18 03:07:52 | 1616036872 | | Ethereum | ETH | 1840.44000000 | 2021-03-18 03:09:41 | 1616036981 | | Ethereum | ETH | 1838.49000000 | 2021-03-18 03:19:50 | 1616037590 | | Ethereum | ETH | 1839.08000000 | 2021-03-18 03:21:16 | 1616037676 | | Ethereum | ETH | 1835.26000000 | 2021-03-18 03:52:03 | 1616039523 | | Ethereum | ETH | 1834.40000000 | 2021-03-18 03:52:14 | 1616039534 | | Ethereum | ETH | 1834.63000000 | 2021-03-18 03:53:57 | 1616039637 | +-----------+-------------+-----------------+---------------------+------------+
https://stackoverflow.com/questions/66684638/find-the-24-hrs-change-in-the-price March 18, 2021 at 12:08PM
没有评论:
发表评论