Answer the question
In order to leave comments, you need to log in
How to group a table by minute (hourly)?
There is a table with fields: market, time, trading volume.
How to group hourly each market displaying trades for a given hour?
I.e
Рынок1 в 12:00 1000
Рынок1 в 12:20 1100
Рынок1 в 12:50 1400
Рынок1 в 13:10 1450
Рынок2 в 12:00 300
Рынок1 12:00 1400
Рынок1 13:00 1450
Рынок2 12:00 300
Answer the question
In order to leave comments, you need to log in
SELECT
рынок,
SUM(объём_торгов),
TIMESTAMPADD(HOUR,TIMESTAMPDIFF(HOUR,CURDATE(),время),
CURDATE()) AS round_date,
FROM your_table
GROUP BY рынок, round_date
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question