I have the following table:
----------------------------------- PK integer date ----------------------------------- 1 2 03/01/01 2 1 04/01/01 3 3 02/01/01 4 3 05/01/01 5 2 01/01/01 6 1 06/01/01
I want to place an order on a date column, BUT have dates with an integer 2 higher order than other integers. My conclusion will be like this.
----------------------------------- PK integer date ----------------------------------- 1 2 01/01/01 5 2 03/01/01 3 3 02/01/01 2 1 04/01/01 4 3 05/01/01 6 1 06/01/01
At the moment, I do not know at all how to achieve this in MySQL, or even if it is possible. I havenโt tried anything yet, because I donโt know where to start.
I have to say that the order of integers that are not 2 is not a concern, so the following table is equally good.
----------------------------------- PK integer date ----------------------------------- 1 2 01/01/01 5 2 03/01/01 2 1 04/01/01 6 1 06/01/01 3 3 02/01/01 4 3 05/01/01
sql database mysql case
Gaz_Edge
source share