sql 获取本周卖出最多的菜品,以及卖出数量

--获取本周卖出最多的菜品,以及卖出数量
    select top 1 pid,COUNT(pid) as p_count from(
        select * from orderdetail where datediff("ww",addtime,getdate())=0
    ) as bzcp --本周菜品
    group by pid
    order by p_count desc

posted on 2013-03-06 20:37  woshilee  阅读(194)  评论(0)    收藏  举报

导航