在mysql中查询某一段时间内的数据 报错where 后面提示语法错误
selectcount(discountid)count3,discountidfromreverts1rgroupbyr.discountidwherereplytim...
select count(discountid)count3,discountid from reverts1 r group by r.discountid where replytime between '2007-12-02 11:25:37' and now()
展开
2个回答
展开全部
where加到group by的前面才对,group by后面的条件用having
select count(discountid) as count3,discountid from reverts1 where replytime between '2007-12-02 11:25:37' and now() group by discountid
select count(discountid) as count3,discountid from reverts1 where replytime between '2007-12-02 11:25:37' and now() group by discountid
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询