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;
原文地址:https://www.cnblogs.com/dengyg200891/p/6012990.html