On Fri, Mar 26, 2010 at 5:00 AM, Fredrik Karlsson <dargo...@gmail.com> wrote:
> Hi,
>
> I have a list of id:s stored in a field. I would now like to get some
> information from a table by these id:s, but exactly in this order. So,
> if I have a table
>
> 1 One
> 2 Two
> 3 Three
>
> and the sequence "3,1,2" stored somewhere, how do I get a neat list like
>
> Three
> One
> Two
>

Try this:

select *, 1 * (name = "Three") + 2 * (name = "One") + 3 * (name =
"Two") sorter from mytab where sorter > 0 order by sorter
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to