Saturday, October 20, 2012

Re: [android-developers] Re: Sqllite order by

Vinicius,

I had the same problem.
To solve it, I normalized the words, replacing the special characters for their correspondent ones ("áaaa" -> "aaaa") and stored them in a new column on the database. Then, I changed the query sort criteria to use this normalized column instead of the original one.

I remember that I tried to use SQLite collation with no success.

On Sat, Oct 20, 2012 at 2:56 PM, RichardC <richard.critten@googlemail.com> wrote:
The problem is that in Unicode there is no relationship between a and á other than the order they appear in the character-set   To change this "natural" order you will have to define special relationships (sort order) for many of the Unicode characters.


On Saturday, October 20, 2012 4:03:12 PM UTC+1, Vinicius wrote:
Special characters in this case are accented. 

For example:

Our that base has the strings [áaaa,aaaa,bbbb], our function to order the query is returning in the following order:

aaaa,bbbb,áaaa

We need that the return of the query should be:

aaaa,áaaa,bbbb

I will check collating sequence that Richard suggested, but waiting for more ideas


On Fri, Oct 19, 2012 at 10:14 PM, Lew <lewb...@gmail.com> wrote:
Vinicius wrote:

we did a query in SQLlite, but the result is not in the order that we need, ie, the character "á" is being shown after z.

How can I configure my query to ignore special characters 

Which characters are "special" to you? It's kind of hard to spell certain words without certain accented characters, for 
example, "voilà".

'getNumericValue()' is a bad idea. It doesn't correspond to collation order. 'Ⅼ' will return 50. 'Ⅻ' will return 12.

There are methods to deal with collation order in Java in case the SQLite functions are just too "lite".

It's a big topic.

-- 
Lew

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com

To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en



--
Silvio Gustavo de Oliveira Santos
Engenheiro de Software

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment