select *from (select id,count(branch_id) as cnt from commuit group by branch_id) as t1 where t1.cn 5

老是提示SQL错误.请大神们看下,语句哪里有问题... 老是提示SQL错误. 请大神们看下,语句哪里有问题 展开
 我来答
micro0369
2013-07-22 · TA获得超过1.2万个赞
知道大有可为答主
回答量:9250
采纳率:85%
帮助的人:4311万
展开全部
什么数据库? 试试这样(把虚拟表的as去掉)?

select * from
(select id,count(branch_id) as cnt from commuit
group by branch_id
) t1 where t1.cn ???

后面还有呢?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名用户
2013-07-23
展开全部
select *from (select id,count(branch_id) as cnt from commuit group by branch_id) as t1 where t1.cn
中where 后面需要加查询条件的,如where t1.cn=2这样
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
dark0oo
2013-07-22 · 超过43用户采纳过TA的回答
知道小有建树答主
回答量:271
采纳率:0%
帮助的人:146万
展开全部
select *from (select id,count(branch_id) as cnt from commuit group by id) as t1 where t1.cn即可
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式