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)

CodePudding user response:

The
reference 1/f, started the first reply:
 
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)


Thank you very much, already can I can ask next 120 and 13 what is the meaning?
Because this is the length of time

CodePudding user response:

The
reference 1/f, started the first reply:
 
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)

If you want to create a separate table will query data updates every day write what to write thank you

CodePudding user response:

120 is the transformation format length of 13 is

Update written by INSERT inserted INTO a SELECT statement
  • Related