MySQL排序:SELECT ORDER BY,mysqlorder

來源:互聯網
上載者:User

MySQL排序:SELECT ORDER BY,mysqlorder

SELECT 和ORDER BY結合進行排序:

products表如下:



a 按產品名稱列進行排序:



b 按多個列進行排序,預設排序次序為升序:



c 指定排序方向,即指定為降序:



d 對多個列進行排序,先按產品價格降序排列,再按產品名稱排列



e 找出某一列最高值或者最低值




mysql 資料表按 小數排序 select * from user order by -(replace(name,'','')) desc

小數點前的資料部計算在內,僅依據小數點後面的資料進行排序;則可以根據截取小數點後面的資料 然後進行排序即可
 
mysql 排序sql語句:select * from c_c where l_id='$row1[id]' order by jg DESC

資料數型轉為 int 型就可以了
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.