Returning query results in predefined order

前端 未结 11 1007
温柔的废话
温柔的废话 2020-11-29 06:01

Is it possible to do a SELECT statement with a predetermined order, ie. selecting IDs 7,2,5,9 and 8 and returning them in that order, based on

11条回答
  •  無奈伤痛
    2020-11-29 06:41

    Best I can think of is adding a second Column orderColumn:

    7 1
    2 2
    5 3
    9 4 
    8 5
    

    And then just do a ORDER BY orderColumn

提交回复
热议问题