bachelor-thesis/chapters/thesis/chapter03_documentlist_sub.sql

30 lines
1.5 KiB
MySQL
Raw Normal View History

SELECT
-- document coauthor person
t0.id, t0.createdat, t0.modifiedat, t0.validuntil, t0.document_id
, t0.status
-- historical person
, t1.personid, t1.pseudonym, t1.wikilink, t1.id, t1.createdat
, t1.modifiedat, t1.validuntil, t1.comments, t1.firstname, t1.surname
, t1.title, t1.birthdatetype, t1.birthstartdatestatus
, t1.birthstartday, t1.birthstartmonth, t1.birthstartyear
, t1.birthendstatus, t1.birthendday, t1.birthendmonth, t1.birthendyear
, t1.deathdatetype, t1.deathstartdatestatus, t1.deathendstatus
, t1.deathstartday, t1.deathstartmonth, t1.deathstartyear
, t1.deathendday, t1.deathendmonth, t1.deathendyear
, t1.dnbref, t1.gender, t1.isinstitution
-- extended biography
, t2.id, t2.createdat, t2.modifiedat, t2.validuntil, t2.description
-- sitecity birth
, t3.id, t3.createdat, t3.modifiedat, t3.validuntil
, t3.extendedbiography_id, t3.city, t3.country, t3.dnbref, t3.region
, t3.sitecityid, t3.wikilink, t3.zipcode
-- sitecity death
, t4.id, t4.createdat, t4.modifiedat, t4.validuntil
, t4.extendedbiography_id, t4.city, t4.country, t4.dnbref, t4.region
, t4.sitecityid, t4.wikilink, t4.zipcode
FROM public.DocumentCoAuthorPerson t0
LEFT OUTER JOIN public.historicalperson t1 ON t0.authorperson_id = t1.id
LEFT OUTER JOIN public.extendedbiography t2 ON t1.extendedbiography_id = t2.id
LEFT OUTER JOIN public.sitecity t3 ON t1.sitecity_birth_id = t3.id
LEFT OUTER JOIN public.sitecity t4 ON t1.sitecity_death_id = t4.id
WHERE t0.document_id = ?