SQL AVERAGE TIME

前端 未结 4 2041
粉色の甜心
粉色の甜心 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:41

    SELECT FROM_UNIXTIME( ( ROUND((UNIX_TIMESTAMP( floor(timestamp_column)) /   60 ),0) *   60 ) ) rounded_time
    FROM mysql_table
    WHERE timestamp_column BETWEEN STR_TO_DATE('31/07/2012','%d/%m/%Y') 
    AND STR_TO_DATE('01/08/2012','%d/%m/%Y')
    

提交回复
热议问题