Order by command with accent in SQLite

6

I'm programming for Android and using the native database ( SQLite ). I want to make a query in the table of products sorted by name, but when doing SELECT like this:

SELECT * FROM produtos ORDER BY nome;

it returns, for example:

Alvejante
Cloro
Sabão Liquido
Água Sanitária

I want SELECT to ignore the score and have the following return:

Água Sanitária
Alvejante
Cloro
Sabão Liquido

Is it possible to do this?

    
asked by anonymous 31.10.2018 / 19:24

1 answer

6

In this case you can use one of these two:

(SUA QUERY) ORDER BY NOME COLLATE UNICODE

(SUA QUERY) ORDER BY NOME COLLATE LOCALIZED

Follow the documentation reference:

  

Localized Collation - ORDER BY In addition to SQLite's default BINARY   collator, Android supplies two more, LOCALIZED, which changes with the   system's current locale, and UNICODE, which is the Unicode Collation   Algorithm and not tailored to the current locale.    LINK

  • Translation:
  

Localized pooling - ORDER BY In addition to the SQLite's collator BINARY pattern,   Android provides two more, LOCALIZED , which changes with   current locale of the system and UNICODE , which is the Unicode Collation   and not adapted to the current location.

    
31.10.2018 / 20:06