mysql中設置文本排序的方法
1.首先,在命令行中啟動MySQL服務;
service mysql start
2.MySQL服務啟動后,在命令行中輸入mysql的用戶名和密碼登錄到MySQL;
mysql -u root -p
3.登錄到MySQL后,選擇使用一個數據庫;
use mysql;
4.最后,進入到數據庫后,在數據庫中執行以下命令即可對文本進行排序;
SELECT * from intd left join(
select * from (
select * from gengxin order by time desc
)
as b group by intd_id
)as c
on intd.id = c.intd_id where c.yihou like '%%' and intd.ddleixing='' and intd.xm1='' order by (select case c.muqian when '' then 1 end) asc