Query 1: For each Symbol starting with the letter "A" compute the lowest and highest trade price every minute for all trades between 9:30am and 4:00pm
Here is my code so far, just need to know how to do the "every minute" part.
SELECT MAX(trade_price) AS HighestPrice, MIN(trade_price) AS LowestPrice
FROM trades_full
WHERE symbol LIKE 'A%'
AND HOUR(trading_date_time) BETWEEN 9.30 AND 16;
1
Expert's answer
2017-04-14T09:19:05-0400
We don't understand any of semantic sense of «every minute» too.
But in general it'll be somewhat like this:
SELECT MAX(trade_price) AS HighestPrice, MIN(trade_price) AS LowestPrice FROM trades_full WHERE symbol LIKE 'A%' AND HOUR(trading_date_time) BETWEEN 9.30 AND 16 GROUP BY MINUTE(trading_date_time)
Comments
Leave a comment