SQL语句错误select * from (SELECT bookid,count(bookid) as degree FROM 10

select*from(SELECTbookid,count(bookid)asdegreeFROMtd_borrowgroupbybookid)asborrjoin(s... select * from (SELECT bookid,count(bookid) as degree FROM td_borrow group by bookid) as borr join (select b.*,c.name as bookcaseName,p.pubname,t.typename from td_bookinfo b left join td_bookcase c on b.bookcase=c.id join td_publishing p on b.ISBN=p.ISBN join td_booktype t on b.typeid=t.id where b.del=0) as book on borr.bookid=book.id order by borr.degree desc limit 10
执行后出现此错误: 消息 102,级别 15,状态 1,第 1 行 'limit' 附近有语法错误。
展开
 我来答
楼之风太泪视1V
2014-12-23 · 超过45用户采纳过TA的回答
知道小有建树答主
回答量:85
采纳率:0%
帮助的人:77.2万
展开全部
limit 10不能在 order 后面哦
追问
应该在哪里?
追答
select  * from  (

select * from (SELECT bookid,count(bookid) as degree FROM td_borrow group by bookid) as borr join (select b.*,c.name as bookcaseName,p.pubname,t.typename from td_bookinfo b left join td_bookcase c on b.bookcase=c.id join td_publishing p on b.ISBN=p.ISBN join td_booktype t on b.typeid=t.id where b.del=0) as book on borr.bookid=book.id order by borr.degree desc

) limit 10
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式