Thanks for the help. I suspected I had to use a secondary select, though I want sure how to use it For others, here is the completed sql
select E1.datetime,R1.email,R2.email,subject,E1.[size],E1.offset,C1.id_block,C1.[size],C1.compression,C1.offset from ( select distinct E2.id from emaildata as E2 INNER JOIN keylocations AS L1 on L1.id_unique = E2.id_unique LEFT JOIN keywords as K1 on K1.id = L1.id_keyword where K1.keyword LIKE '%word1%' or where K1.keyword LIKE '%word2%' ) as filt inner join emaildata as E1 on E1.id = filt.id left join subjects on id_subject = subjects.id left join recipients as R1 on E1.id_from = R1.id left join recipients as R2 on E1.id_to = R2.id left join chunkinfo as C1 on E1.id_chunk = C1.id; cheers Darren -- View this message in context: http://www.nabble.com/Search-a-Select-in-another-Select-tp25234534p25235045.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

