Reputation: 1
In my SQLite query:
"SELECT * FROM menu WHERE ID IN (" & optList & ") ORDER BY seqno"
optList is a list of ID's and something like:
"01","02","14","03"
The corresponding seqno values for these rows are: 01 02 03 04
and this is the order I need to have but the rows returned are in ID order, i.e. 01, 02, 14, 03
Does the ORDER BY
not work when using WHERE IN
and/or is there some other way of returning the rows in the desired order?
Upvotes: 0
Views: 114
Reputation: 73
This worked fine for me
SELECT *
FROM `accolades`
WHERE id
IN ( 1, 3, 4, 5 )
order by id asc
Upvotes: 1