On Fri, Mar 26, 2010 at 1:25 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > Fredrik Karlsson wrote: >> 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. > > Well, you can generate a statement of the form > > select name from mytab where id in (3, 1, 2); > > I don't believe either SQLite or MySQL guarantees that the rows will always > come out in the order in which IDs are listed in the IN clause. But I won't > be surprised if they do happen to come out this way, as an implementation > detail. I'm not sure I'd be comfortable relying on such behavior though. > -- > Igor Tandetnik
Oh, ok. I did not think of that. Indeed, this is the behaviour of R %in% too, so I should really have thought of this. Since this is a calculated path in a directed graph, order is important, and so I will go with a temporary (in memory?) table. Thank you for your great help! /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