2009/3/18 Hoover, Jeffrey <jhoo...@jcvi.org>: > > Assumming this is only one row in tbl2 where name='Joe'... > > this should work: > SELECT * FROM tbl1 > WHERE description='someval' > AND foreign_key_id=(select id from tbl2 where name='Joe'); > > this is better: > select tbl1.* from tbl1, tbl2 > where tbl1.description='someval' > AND tbl2.name='Joe' and tbl2.id=tbl1. foreign_key_id; > > if there may be many rows in tbl2 where name =- 'Joe' then > SELECT * FROM tbl1 > WHERE description='someval' > AND foreign_key_id in (select id from tbl2 where name='Joe');
Both of the top 2 worked. Thank you. I'll try and stick to the less ambiguous form and bear in mind all the comments about single quotes. A bit more information though. Is there a term for that type of SELECT statement? Thanx, Dp. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users