Ooo nostalgie

Een query van mij van 20 augustus 1999 — ik dacht dat ik in dit tijd veel viezere SQL schreef.

SELECT aut_name, aut_id, aut_picture, aut_birthdate, aut_deathdate, aut_bio, function_id, function_name,
book_title, book_year, book_pages, book_id, book_price, book_isbn, book_originaltitle,
publisher_name,
owner_name,
series_name, series_id, book_series_number
FROM tblOwners
RIGHT JOIN (
tblPublishers
RIGHT JOIN (
tblSeries
RIGHT JOIN (
tblBooks
LEFT JOIN (
tblAuthors
RIGHT JOIN (
tblBook_Authors
LEFT JOIN
tblFunctions ON tblBook_Authors.ba_function_id=tblFunctions.function_id)
ON tblAuthors.aut_ID = tblBook_Authors.ba_aut_ID)
ON tblBooks.book_ID = tblBook_Authors.ba_book_ID)
ON tblSeries.series_id = tblBooks.book_series_id)
ON tblPublishers.publisher_id = tblBooks.book_publisher_ID)
ON tblOwners.owner_id = tblBooks.book_owner_id
WHERE book_id=#attributes.book_id#
ORDER BY aut_name, series_name, book_series_number, book_year, book_title

De reden dat ik daar was, was dat ik –om iets in een ander programma te testen– een lijst van boeken, auteurs en ISBN-nummers nodig had. En dus:

SELECT book_title, book_isbn, aut_name
FROM tblBooks, tblBook_Authors, tblAuthors
WHERE book_ID=ba_book_ID AND ba_aut_id=aut_id AND ba_primary=1

Tsk tsk. Ik zou eigenlijk dringend die boekdatabase moeten aanpassen… Ik heb echt wel zin, maar tijd? Aaaaa!