On 10/6/05, Robert L Cochran <[EMAIL PROTECTED]> wrote: > > I want to craft an SQL query that will return every row in A having a > primary key that does not match the keys in the rows in B. Then display > these rows on a web page form. I eventually tried doing a left outer > join of A and B:
select * from a where a.id <http://a.id> not in ( select distinct id from b ) D:\temp\convention>sqlite3 SQLite version 3.0.8 Enter ".help" for instructions sqlite> create table a ( id integer, stuff text ); sqlite> create table b ( id integer, path text ); sqlite> insert into a(id,stuff) values(1,'one'); sqlite> insert into a(id,stuff) values(2,'two'); sqlite> insert into b values(1,'one'); sqlite> select * from a where a.id <http://a.id> not in ( select distinct id from b ); 2|two sqlite> You might also consider NOT saving the image data in the database. I've always found it better to save a path or URL in the database and store the image in the file system. (Unless you're searching for things in the image data itself and not just searching for an image using other fields as keys)