is it possible to set a `order` field with the result of ORDER BY

My table:

id label
1 art2
2 art1
3 art4
4 art3

Expected Output:

id label order
1 art2 2
2 art1 1
3 art4 4
4 art3 3

So, I want to set the "order" field with result of

SELECT * FROM table ORDER BY label ASC;

Is it possible with a single request? Or should I just get result and then update order in my app ?



Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)