On 12.08.11 09:41, Eduardo wrote: > Dear All, > I have a list of elements for which I need to establish if they are in > a tadabase. I can make for each element a separate query but I am > afraid that that is not the best approach what is the best practice in > this case? > Thanks >
Depending on the size of the list I would use the in_ operator[1]. If you're talking about a really long list [2] you might drop everything to a temporary list and join from there. Mariano [1] http://www.sqlalchemy.org/docs/orm/tutorial.html#common-filter-operators [2] in old days there were limits to the amount of items in an "in" operator, I'm not sure if it still holds nowadays. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.