为什么说SQL命令未正确结束?

wshqwe 2013-12-17 08:03:26
代码如下
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;

求解
...全文
154 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
齐岳 2013-12-17
  • 打赏
  • 举报
回复
group by 放在 where字句 之后
CT_LXL 2013-12-17
  • 打赏
  • 举报
回复
引用 楼主 wshqwe 的回复:
代码如下 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

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧