I have a SQLite query like this:
SELECT Books.title, People.name FROM Books, People WHERE People.ID=Books.AuthorID
Where Books.AuthorID is an ID number corresponding to an ID in the People table.
Output:
Title Author
Book1 John Doe
Book2 Martha James
But I want to add in a 3rd field (Books.EditorID) that also is an ID which has to be looked up in People, but chances are it’ll be a different ID/Person than Books.AuthorID is.
Desired output:
Title Author Editor
Book1 John Doe Jack Brown
Book2 Martha James Bob Nelson
How can this be accomplished? I believe some sort of JOIN query?
1 Answer