SQL Server Group statistics in 10-minute numbers

Source: Internet
Author: User

Please count every 10 minutes for the time period starting from 7 o'clock in the morning every day.

Solution Ideas:

I have done a month before, that is, every 3 months in groups, in fact, is the same. But maybe, the overall data volume is a problem for the General Assembly. If you're just asking for a day, that's absolutely fine.
"1" If only that day, then you take the day seven points, calculate the day all the time and its minute difference, then group by minute difference/10 can
"2" If it is all the data, then you add the time period condition in the where, and then find the earliest time point for the minute difference between the current time and the earliest point of the group by/10

This friend is dead write, this article takes the day for example AH

"1" Build a table and test it.

"2" Using minute difference/10 grouping

"3" display is not intuitive, converted into time display

SQL Server Group statistics in 10-minute numbers

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.