order by

4order by1order by price         //默认升序排列
(2order by price desc //降序排列
(3order by price asc  //升序排列,与默认一样
(4order by rand()      //随机排列,效率不高
    #按栏目号升序排列,每个栏目下的商品价格降序排列
    select * from goods where cat_id !=2 order by cat_id,price desc;

 

posted @ 2016-10-30 13:34  Xiao|Deng  阅读(198)  评论(0编辑  收藏  举报