android - How to sort by text first and then text containing numbers -


in sqllite table, have column values in table

  • mario
  • fly machine
  • evil dead
  • 4 cross sudoku
  • 20 cross sudoku
  • 15 cross sudoku
  • simcity

how sort have text first, , sorting of text prefix numbers.

output required:

  • evil dead
  • fly machine
  • mario
  • simcity
  • 4 cross sudoku
  • 15 cross sudoku
  • 20 cross sudoku

you can try this

select *    table1  order cast(column1 integer), column1 

output:

 |         column1 | ------------------- |       evil dead | |     fly machine | |           mario | |         simcity | |  4 cross sudoku | | 15 cross sudoku | | 20 cross sudoku | 

here sqlfiddle demo


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -