SQL - retain ordering based on the query params

前端 未结 7 1929
借酒劲吻你
借酒劲吻你 2021-02-10 08:34

I\'m trying to perform a SELECT with an IN clause and I would like to be able to have the results returned in the same order as the elements in my list

7条回答
  •  鱼传尺愫
    2021-02-10 09:00

    I made an answer here in a more recent question

    https://stackoverflow.com/questions/14234748/preserve-rows-order-in-select-query-as-same-in-statement

    My answer use a pipe row function so it doesn't need to use a temp table like the accepted answer here.

提交回复
热议问题