samedi 12 septembre 2015

SQLITE: How do I sort a String column containing values 1-99 and letters a-z, with numbers first then letters

I want a sort order for a string column like the following (numbers first, letters last):

1
2
...
10
11
...
A
B
C
...

Here's my current query

SELECT * FROM PAGES_VIEW ORDER BY CAST(chapterTitle as integer)

Unfortunately, this results in the following ordering (letters first, numbers last)

A
B
C
...
1
2
...
10
11
...

How do I achieve my desired order?

Aucun commentaire:

Enregistrer un commentaire