मुझे संदेह है कि आप बस कुछ ऐसा चाहते हैं: SELECT HOUR(ShoppingDate), COUNT(*) FROM YourTable GROUP BY HOUR(ShoppingDate)