代码如下
select c.idcard,name,age,address
from t_customer c,t_branch b,t_account a
group by b.branch_code
where c.idcard = a.cust_idcard and b.branch_code = a.branch_code and branch_city = '福州';
运行就提示第四行SQL命令未正确结束
如果去掉一些改成下面就可以但是不是我要的结果...
select c.idcard,name,age,address
from t_customer c,t_branch b,t_account a
where c.idcard = a.cust_idcard and b.branch_code = a.branch_code;
求解
------解决方案--------------------
先WHERE再GROUP BY
------解决方案--------------------
group by 放在 where字句 之后