/ Published in: MySQL
Okay,
If it is required to sort columns like this
1A
1a
10A
9B
21C
1C
1D
And Our desired Result is
1A
1C
1D
1a
9B
10A
21C
We can use casting, but casting will not sort 1A, 1B,1C properly. To overcome this issue we are first converting this column to binary and sorting the binary combined with tbl_column.
hehe,,, after doing some headbanging just did it with casting too... and using same logic... damn why I didnt thought of that.
If it is required to sort columns like this
1A
1a
10A
9B
21C
1C
1D
And Our desired Result is
1A
1C
1D
1a
9B
10A
21C
We can use casting, but casting will not sort 1A, 1B,1C properly. To overcome this issue we are first converting this column to binary and sorting the binary combined with tbl_column.
hehe,,, after doing some headbanging just did it with casting too... and using same logic... damn why I didnt thought of that.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML