{sql:select * from her_woodland
JOIN her_project on her_project.rowid=her_woodland.fileno
WHERE her_project.rowid = @File Number@
}
GAZETTEER OF SITES
M. SHINER, Historic Environment Record Manager
{subtable:
SELECT camp_core.prn,
ifnull(camp_core.name,' ') as name,
ifnull(her_condition.evidence,' ') as evidence,
ifnull(camp_core.summary,' ') as s1,
ifnull(camp_core.desc_1,' ') as d1,
ifnull(geo_locations.ngr,' ') as ngr,
ifnull(geo_locations.community,' ') as community,
ifnull(GROUP_CONCAT(DISTINCT concat(ifnull(her_core_site_type.type,' ')) SEPARATOR '/ '),' ') as t1,
ifnull(GROUP_CONCAT(DISTINCT concat(ifnull(her_core_site_type.period,' ')) SEPARATOR '/ '),' ') as p1,
ifnull(GROUP_CONCAT(DISTINCT concat(ifnull(her_condition.condition,' ')) SEPARATOR '/ '),' ') as c1,
ifnull(GROUP_CONCAT(DISTINCT concat(ifnull(her_source1.author,' '),' ',ifnull(her_source1.year,' '),' ',ifnull(her_source1.title,' '),' ',ifnull(her_source1.other,' ')) SEPARATOR '[br]' ),' ') as sources,
ifnull(GROUP_CONCAT(DISTINCT concat(ifnull(her_source2.author,' '),' ',ifnull(her_source2.year,' '),' ',ifnull(her_source2.title,' '),' ',ifnull(her_source2.other,' ')) SEPARATOR '[br]' ),' ') as source2
FROM her_woodland
JOIN her_project_link on her_project_link.fileno=her_woodland.fileno
JOIN camp_core on camp_core.watprn=her_project_link.watprn
JOIN geo_locations on geo_locations.watprn=camp_core.watprn
JOIN her_core_site_type on her_core_site_type.watprn=camp_core.watprn
LEFT JOIN her_condition on her_condition.watprn=camp_core.watprn
left join her_source1_link on her_source1_link.watprn=camp_core.watprn
left join her_source1 on her_source1.rowid=her_source1_link.source_id
left join her_source2 on her_source2.watprn=camp_core.watprn
WHERE her_project_link.fileno=[rowid]
group by camp_core.watprn
order by camp_core.prn ASC;
title:[b]PRN -[/b] ,prn, [br][br][b]NAME -[/b] , name , [b]TYPE -[/b] ,t1, [b]PERIOD -[/b] , p1, [br][br][b]EVIDENCE -[/b] ,evidence, [b]CONDITION -[/b] ,c1, [br][br][b]NGR -[/b] , ngr , [b]COMMUNITY -[/b] ,community, [br][br][b]HER DESCRIPTION -[/b][br],s1 , [br],d1 ,[br][br][b]SOURCES -[/B] ,sources, [br][br][b]SOURCE 2[/B] ,source2, [br]}