未知列 '2' “有序条款”
select count(distinct(vw_SIPMIP.product_id)) from vw_SIPMIP , sp_mip_rule
where
vw_SIPMIP.product_id not in (select a.product_id from vw_non_SIPMIP a)
and sp_mip_rule.id = vw_SIPMIP.id
and sp_mip_rule.createdby != '_IMPORT' limit 1
我不断收到此错误
select count(distinct(vw_SIPMIP.product_id)) from vw_SIPMIP , sp_mip_rule
where
vw_SIPMIP.product_id not in (select a.product_id from vw_non_SIPMIP a)
and sp_mip_rule.id = vw_SIPMIP.id
and sp_mip_rule.createdby != '_IMPORT' limit 1
I am keep getting this error
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的语法在distinct上不正确...通过使用(parens),它认为Distinct是一个函数,并期望内部值作为参数传递并获取一个值...你想要的是...另外,因为您没有要返回的其他列,所以不需要限制... COUNT(*) 或 COUNT(DISTINCT SomeColumn) 将始终单独返回一行...不需要分组。
your syntax is incorrect on the distinct... By using the (parens), it is thinking Distinct is a function and expecting the inner value as a parameter to pass and get a value back... what you want is... Additionally, since you have no other columns you are returning, you don't need a limit one... COUNT(*) or COUNT(DISTINCT SomeColumn) will ALWAYS return a single row all by itself... no group by needed.