i have an app that makes this SQL query to a database with two tables, a 
table with items and a table with datesets. Each dataset can be from a 
item, and it is a set of dates ( :) )

SELECT distinct items.date from items left join datesets on 
items.inicio=datesets.capoID and items.capoID=datesets.capoID ORDER BY 
datesets.date

I am ordering by datesets.date because date is a integer representing the 
date, for example: 1357340400

On android 4.X phones the query gives me correctly ordered result. The 
result of the query is:

11-28 13:24:09.457: I/System.out(9148): 16-03-201211-28 13:24:09.457: 
I/System.out(9148): 01-06-201211-28 13:24:09.457: I/System.out(9148): 
22-06-201211-28 13:24:09.457: I/System.out(9148): 21-07-201211-28 13:24:09.457: 
I/System.out(9148): 26-09-201211-28 13:24:09.457: I/System.out(9148): 
30-10-201211-28 13:24:09.457: I/System.out(9148): 05-12-201211-28 13:24:09.457: 
I/System.out(9148): 08-12-201211-28 13:24:09.457: I/System.out(9148): 
27-12-201211-28 13:24:09.457: I/System.out(9148): 05-01-201311-28 13:24:09.457: 
I/System.out(9148): 25-02-201311-28 13:24:09.457: I/System.out(9148): 
10-03-201311-28 13:24:09.457: I/System.out(9148): 23-04-201311-28 13:24:09.457: 
I/System.out(9148): 27-04-201311-28 13:24:09.457: I/System.out(9148): 
11-05-201311-28 13:24:09.457: I/System.out(9148): 23-06-201311-28 13:24:09.457: 
I/System.out(9148): 01-07-201311-28 13:24:09.457: I/System.out(9148): 
15-08-201311-28 13:24:09.457: I/System.out(9148): 11-09-201311-28 13:24:09.457: 
I/System.out(9148): 21-09-2013

In Android 3.2, 2.3, etc (lower versions than 4), the result is incorrect, 
is not properly ordered:

11-28 13:22:50.734: I/System.out(3181): 01-06-201211-28 13:22:50.734: 
I/System.out(3181): 16-03-201211-28 13:22:50.734: I/System.out(3181): 
21-07-201211-28 13:22:50.734: I/System.out(3181): 26-09-201211-28 13:22:50.734: 
I/System.out(3181): 22-06-201211-28 13:22:50.734: I/System.out(3181): 
30-10-201211-28 13:22:50.734: I/System.out(3181): 08-12-201211-28 13:22:50.734: 
I/System.out(3181): 27-12-201211-28 13:22:50.734: I/System.out(3181): 
05-01-201311-28 13:22:50.734: I/System.out(3181): 05-12-201211-28 13:22:50.734: 
I/System.out(3181): 25-02-201311-28 13:22:50.734: I/System.out(3181): 
10-03-201311-28 13:22:50.734: I/System.out(3181): 23-04-201311-28 13:22:50.734: 
I/System.out(3181): 27-04-201311-28 13:22:50.734: I/System.out(3181): 
11-05-201311-28 13:22:50.734: I/System.out(3181): 23-06-201311-28 13:22:50.734: 
I/System.out(3181): 01-07-201311-28 13:22:50.734: I/System.out(3181): 
15-08-201311-28 13:22:50.734: I/System.out(3181): 11-09-201311-28 13:22:50.734: 
I/System.out(3181): 21-09-2013

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to