假设我有一个包含此字段的数据库 Client_number,Account_number,Age,Account_balance_statement
如何使用帐户数量及其每个客户的总余额报表生成查询
如何为每位年龄等于或大于22岁的客户生成平均余额报表
谢谢
答案 0 :(得分:0)
SELECT count(Account_number),
sum(Account_balance_statement)
FROM yourtable
和
SELECT Client_number,
Age,
avg(Account_balance_statement)
FROM yourtable
WHERE Age >= 22
GROUP BY Client_number, Age
这应该这样做,对吧?