select * from (select top 10 * from ( select sum(number) as amount,ISBN from tb_Order_detail group
select * from (select top 10 * from ( select sum(number) as amount,ISBN from tb_Order_detail group by ISBN )as tab order by amount desc) o inner join tb_bookinfo b on o.ISBN=b.ISBN order by o.amount desc
帮忙分析解释一下这个语句 特别是后边的这个是什么意思啊 o inner join tb_bookinfo b on o.ISBN=b.ISBN order by o.amount desc
INNER JOIN 运算
组合两个表中的记录,只要册逗在公共字段之中有相符的值。
o 是(select top 10 * from ( select sum(number) as amount,ISBN from tb_Order_detail group by ISBN )as tab order by amount desc) 作为o表,就是组合o表和 tb_bookinfo 表(b表)两个表的记录,只取出这两个表州纯卖里面相符的值,条件就裤颂是o.ISBN=b.ISBN order by o.amount desc
外链///O表连接B表..好像吧