日期:2014-05-18 浏览次数:20549 次
(select type,count(type) type_count from (select type from book where id in (select bookid from OrderDetails where orderid in (select id from orders where userid = (select id from userinfo where name='ccccc')))) a group by type ) b)
(select TOP 1 type,count(type) type_count from
(select type from book where id in
(select bookid from OrderDetails where orderid in
(select id from orders where userid =
(select id from userinfo where name='ccccc')))) a group by type ) b)
ORDER BY COUNT(type) DESC