Home > database > Used to query data table every hour the amount of data that how to write?
Used to query data table every hour the amount of data that how to write?
Time:09-30
Have time to time field Is the 2019-11-03 10:21:46. 000 displays
It is better for tabular form output The 2019-11-01 01 specific number The 2019-11-01 02 specific number The 2019-11-01 03 specific number
Thank you for your attention
CodePudding user response:
Select dt=the convert (varchar (13), [time], 120), Qty=count (1) The from [table name] Group by the convert (varchar (13), [time], 120) The order by the convert (varchar (13), [time], 120)