SELECT ROUND(close,0), SUM(volume) FROM stocks.stock_prices_minute
WHERE SYMBOL = 'AAPL'
AND DATE(date) = '2012-09-21'
GROUP BY ROUND(close, 0)
Above, 'close' is the name of the column with 1-minute (or whatever you have) close prices, 'volume' is the name of the column with volume data, stocks is the database, and stock_prices_minute is the table.
Here's a graph of a similar query (I removed the date requirement in order to get all data within the period I had available).
No comments:
Post a Comment