2

mysql order by 如何自定义列?

 2 years ago
source link: https://www.v2ex.com/t/798242
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  MySQL

mysql order by 如何自定义列?

  wunonglin · 1 小时 54 分钟前 · 49 次点击
SELECT a, b, c, d FROM table ORDER BY a DESC;

order by 是动态的根据传入的 a,b,c,d 带进去的。

我从 orm 插入后是个字符串.....

SELECT a, b, c, d FROM table ORDER BY 'a' DESC;

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK