Home  >  Article  >  Backend Development  >  SQL 按最后位数排序

SQL 按最后位数排序

WBOY
WBOYOriginal
2016-06-23 13:06:531083browse

老板奇怪的要求

字段:ID
内容: 1001  1002 1010  

要求输出排序: 
1010  
1001  
1002 

如何写?


回复讨论(解决方案)

... order by right(ID,1) asc

... order by right(ID,1) asc



没效果呢
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn