I have problem with ordering of my table by row with prices array. Below example rows:
1) ;100
2) ;50
3) ;50;100;300
4) ;30;150
I want to order by first element of array. When I order by price row ASC I get:
1) ;100
2) ;30;150
3) ;50
4) ;50;100;300
It is wrong result because "100" should be last... I tried:
ORDER BY CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(`price`, ';', 2), ';', 1) AS INT(3) ASC
But still wrong... Any clue?