Emerald habitats

select * from (SELECT h.code_2000,
    h.habitat_unique_id,
    h.scientific_name,
    h.habitat_description,
    null as habitat_prioriy,
    h.habitat_category,
    null as number_sites,
    s.id_site as site_code,
    null as habitat_group,
    null as caves,
    null as coverage_ha,
    p.ThumbnailURL as picture_url
FROM EUNIS.v1r3.Habitat_Emerald s
LEFT JOIN [EUNIS].[latest].[Habitat_Information] h ON s.id_habitat = h.id_habitat
LEFT JOIN EUNIS.latest.HDAnnexI_habitat_photos p ON h.code_2000 = p.code_2000 and p.main=1
) a

No data