2017-04-20 83 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