> Also, you may want to consider avoiding performing an IN on a UNION. > As far as I know, SQLite doesn't optimize that, so will build the > entire union before performing the IN. If you instead do the > following, it should be a lot faster (if you have lots of data). But > I may be wrong.
Err... I think the sub-query in an IN clause has to be executed before the outer query can be started, so whether you do two sub-queries and UNION them or two sub-queries and separately check the results wouldn't seem to make much difference to me. Either way, both have to be executed before anything else can be done. -T ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------