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' 附近有语法错误。 展开
执行后出现此错误: 消息 102,级别 15,状态 1,第 1 行 'limit' 附近有语法错误。 展开
1个回答
展开全部
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
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询