0
我有以下查詢:截斷在選擇
SELECT
SUM(`SPEND_AMOUNT`) AS 'Total Spend Amount',
SUM(`SPEND_AMOUNT`)/COUNT(DISTINCT `INVOICENUMBER`) AS 'Average Spend Amount'
FROM
`TABLE`
我想截斷結果的「平均消費金額」爲幫助兩位小數places.Thanks(?)。
我有以下查詢:截斷在選擇
SELECT
SUM(`SPEND_AMOUNT`) AS 'Total Spend Amount',
SUM(`SPEND_AMOUNT`)/COUNT(DISTINCT `INVOICENUMBER`) AS 'Average Spend Amount'
FROM
`TABLE`
我想截斷結果的「平均消費金額」爲幫助兩位小數places.Thanks(?)。
回合(SUM(SPEND_AMOUNT
)/ COUNT(DISTINCT INVOICENUMBER
),2)
檢查此http://www.w3resource.com/mysql/mathematical-functions/mysql-truncate-function.php –