Select records in table A with *only* certain corresponding records in table B
问题 For example, say you have a table of files and a logging table of transfer operations. CREATE TABLE files ( id INTEGER PRIMARY KEY -- various other columns ); CREATE TABLE transfers ( id INTEGER PRIMARY KEY, file_id INTEGER, status TEXT NOT NULL, -- various other columns FOREIGN KEY (file_id) REFERENCES files (id) ) A transfer operation can have various statuses -- 'succeeded' , 'failed' , 'in progress' , etc. One file can have many transfer operations -- in particular, if a transfer fails,