1
我有這樣的SQL查詢SQL彙總別名爲
Select
Case
When transfer.trf_type = 'c' then 'Transfer to own card'
When transfer.trf_type = 'o' then 'Transfer to own account'
When transfer.trf_type = 'I' then 'Transfer to a domestic bank'
When transfer.trf_type = 'b' then 'Transfer to another AIIB Customer'
End As Type ,
Count(transfer.trf_type) As total,
Sum (transfer.amount*currency.rate) AS totalSum
From transfer
Inner Join currency on transfer.currency = currency.currency
Where transfer.to_card IS null
Group By Rollup(Type)
它給我的結果與總和但有一個空的空間設置。
我想彙總行顯示一個特定的別名,例如:「總資金轉移」。我可以如何實現這一目標?
這裏是我的查詢結果,我需要在最後一排加總
謝謝
環繞你查詢了在派生表,包括案件。按彙總彙總其結果。 – jarlh
你的意思是你想要一個帶空格的列名?.. –