> When I enter a new book, I want the author to default to the last author in > the database. (For the sake of this example you can ignore tricks involving > deleting authors and reusing ids.) >
I'm not sure I understood you correctly, but the query INSERT INTO Books (Author, Title) VALUES ((Select Max(rowid) FROM Authors), "test") just worked (tested it), sure you have to make id autoincrement to ensure Max(rowid) is actually the last author Max _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users