I'm trying to sort some data in my android app with sqlite with the query
cursor c = db.query(TABLE_NAME, null, DRILL_TYPE + " IN ('type 1', 'type 2');", null, null, null, SIZE + " ASC", null);
I'm expecting the results to come out sorted by size, regardless of whether the drill is type 1 or 2, but I'm getting all of type 1 sorted, and then I'm getting all of type 2 sorted. What's wrong with my query that's resulting in this?
expected:
type 1 1
type 2 2
type 1 3
type 2 4
type 1 5
type 2 6
actual result:
type 1 1
type 1 3
type 1 5
type 2 2
type 2 4
type 2 6
Edit, after the original question was answered :-
removing the semicolon at the end of the order part fixed things when I use IN, but not when I use NOT IN