Resource id #3
SELECT (select name from core.page where id = description_page_id) as page_name, collection.id::integer as collection_id, '
' || '

' || (select upper(name) from core.page where id = description_page_id)::text || '

' || location_country::text || ', ' || array_to_string ( ARRAY[location_administration_1::text, location_administration_2::text , location_administration_3::text, location_administration_4::text ], ', ' )::text || '
' || btrim( array_to_string ( ARRAY[ ''::text, date_collected_text::text, collector_name::text || ' ' || collector_collection_code::text ], ', ' )::text , ', ' )::text || '' as collection_title, '../../?' || (select name from core.page where id = description_page_id) as collection_url, '../../image/uploaded/' || BTRIM( split_part( split_part( cd.description_images, 'image/uploaded/' , 2 ) , '"' , 1 ) ) as collection_file_url, BTRIM(location_longitude) as longitude, BTRIM(location_latitude) as latitude, 500 as width, 375 as height, date_collected_text as upload_date, collector_collection_code as collector_id, collector_name, '' as collector_url FROM collection join clade_description cd on (collection.ref_key = cd.description_id) WHERE location_longitude::text != '' AND location_latitude::text != '' AND lower(clade_subfamily::text) = 'limacelloideae'::text ORDER by clade_genus, clade_species, clade_subspecies, clade_variety, clade_form ERROR: column "clade_subfamily" does not exist LINE 44: AND lower(clade_subfamily::text) = 'limacelloideae'::text ^