SQL AVERAGE TIME

前端 未结 4 2042
粉色の甜心
粉色の甜心 2021-01-27 00:45

I have the following query in MSSQL:

select 
TRANSACTION_TYPE_ID
,COUNT(TRANSACTION_TYPE_ID)AS NUMBER_OF_TRANSACTIONS
,CAST(SUM(AMOUNT)AS DECIMAL (30,2)) AS TOTA         


        
4条回答
  •  孤城傲影
    2021-01-27 01:31

    One way would be to convert the time to seconds, calculate the average, and then convert it back to hours, minutes and seconds for the result.

提交回复
热议问题