2017-04-20 289 views

回答

2

嘗試類似:

select description, sum(amount) 
from tab 
group by description 
having sum(amount) > 5000 
; 
+0

非常感謝。我需要一個更多的幫助。帳戶表包含acno和酸。 Tab由酸組成。要將基於acno的上述查詢分組,我應該寫。從標籤中選擇acno,description,sum(amount),accounts.acid = tab.acid group by acno,描述具有總和(金額)> 5000。 – Ankit