My data structure in SQL Server is as follows:
I have a series of IDs that I want to sort my list based on these IDs.
For example:
my_ids = 3,5
My final table will be shown as below:
Is this workable? What is your suggestion for this? Thankful
My data structure in SQL Server is as follows:
I have a series of IDs that I want to sort my list based on these IDs.
For example:
my_ids = 3,5
My final table will be shown as below:
Is this workable? What is your suggestion for this? Thankful
1条答案
按热度按时间0ve6wy6x1#
This can be done using the conditional order :
Demo here