Returning query results in predefined order

前端 未结 11 1028
温柔的废话
温柔的废话 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:55

    All ordering is done by the ORDER BY keywords, you can only however sort ascending and descending. If you are using a language such as PHP you can then sort them accordingly using some code but I do not believe it is possible with MySQL alone.

提交回复
热议问题