{sql: SELECT ifnull(her_core.prn,'') `PRN`, ifnull(her_core.name,'') `Site Name`, ifnull(her_core.summary,'') Summary, ifnull(her_core.desc_1,'') Description, concat('www.cofiadurcahcymru.org.uk/arch/query/page.php?prn=',her_core.watprn,'&dbname=$geoGroupId&tbname=core') AS `url`, ifnull(her_core.form,'') `Form`, group_concat(distinct ifnull(her_core_site_type.period,'') separator ';') `Period`, group_concat(distinct ifnull(her_core_site_type.type,'') separator ';') `Type`, group_concat(distinct ifnull(her_core_site_type.broadclass,'') separator ';') `Broad Class`, group_concat(distinct ifnull(her_management_record.category,'') separator ';') `Category`, group_concat(distinct ifnull(her_condition.condition,'') separator ';') `Condition`, group_concat(distinct ifnull(her_condition.evidence,'') separator ';') `Evidence`, group_concat(distinct ifnull(her_status.status,'') separator ';') `Status`, group_concat(distinct ifnull(her_status.grade,'') separator ';') `Status Grade`, group_concat(distinct ifnull(her_status.reference,'') separator ';') `Status Ref`, ifnull(geo_locations.unitary,'') `Unitary Authority`, ifnull(geo_locations.community,'') `Community`, ifnull(geo_locations.ngr,'') `NGR`, ifnull(geo_locations.map,'') `Map Sheet`, ifnull(geo_locations.rowid,0) `Rowid`, ifnull(x(geo_locations.geo),'') `Easting`, ifnull(y(geo_locations.geo),'') `Northing` FROM her_core LEFT JOIN geo_locations ON her_core.watprn = geo_locations.watprn LEFT JOIN her_core_site_type ON her_core_site_type.watprn = her_core.watprn LEFT JOIN her_management_record ON her_management_record.watprn = her_core.watprn LEFT JOIN her_status ON her_status.watprn = her_core.watprn LEFT JOIN her_condition ON her_condition.watprn = her_core.watprn WHERE `her_core`.`watprn` IN(search_selection(her_core)) GROUP BY `her_core`.`watprn` ORDER BY `her_core`.`name` }