On Fri, Mar 26, 2010 at 12:22 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 26 Mar 2010, at 9:00am, Fredrik Karlsson wrote: > >> 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 > > I can't find a function which does what you want. The SQL-like solution to > it is to have your '3,1,2' written to a table as three records, then use a > JOIN or a sub-SELECT to make SQL return the right records in the right order. > > Simon.
Hi, This is of course another solution. I guess, coming from R, I was looking for a substitute for th %in% operator (or the MySQL IN operator as it turns out, now that I've Googled this some more) but a temp table would also do the trick I guess. Thank you! /Fredrik -- "Life is like a trumpet - if you don't put anything into it, you don't get anything out of it." _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users