yes, i have also tried with sqlite3 and it didn't work. see how awesome mysql is?
any postgresql users, does psql support this? On 13 Mayıs, 20:37, Francisco Costa <m...@franciscocosta.com> wrote: > Thank you Mengu > I've converted my DB to MySQL. In SQLite didn't work. > > On May 13, 3:48 pm, Mengu <whalb...@gmail.com> wrote: > > > > > yes, this is possible. i don't know other databases but possible with > > MySQL. > > > db(db.space.id.belongs((result_id))).select(orderby="FIELD(id, > > 1,6,136,2,18,119,122)") > > > On 13 Mayıs, 17:28, Francisco Costa <m...@franciscocosta.com> wrote: > > > > yes, then 2,18,119,122 > > > > On May 13, 3:22 pm, Mengu <whalb...@gmail.com> wrote: > > > > > so you want them to be ordered as first 1 then 6, then 136 etc? > > > > > On 13 Mayıs, 13:53, Francisco Costa <m...@franciscocosta.com> wrote: > > > > > > I have this query db(db.space.id.belongs(result_id)).select() > > > > > the result id is an unsorted array of ids > > > > > I don't want the query results to be order by id > > > > > > The SQL list this > > > > > SELECT space.id, space.name FROM space WHERE space.id IN > > > > > (1,6,136,2,18,119,122) > > > > > > i want the result to be in the order of the ids array