SQL: ORDER BY using a substring within a specific column… possible?

前端 未结 7 757
清酒与你
清酒与你 2020-11-30 12:02

I have a database whose columns are npID, title, URL, and issue.

Here is an example of two years\' entries:

npID               title               UR         


        
7条回答
  •  无人及你
    2020-11-30 12:12

    You could make the sub string part of the data being selected

    SELECT npId, title, URL, issue, SUBSTRING(issue, 4) AS strsort FROM tbl ORDER BY strsort, issue
    

提交回复
热议问题