ALTER TABLE dsm_organizations ADD COLUMN registered_funder boolean; CREATE VIEW funders_view AS SELECT o.id AS id, o.legalshortname AS legalshortname, o.legalname AS legalname, o.websiteurl AS websiteurl, o.logourl AS logourl, o.country AS country, o.dateofcollection AS registrationdate, o.registered_funder AS registered FROM dsm_organizations o JOIN dsm_service_organization so ON (o.id = so.organization) JOIN dsm_services s ON (so.service = s.id) JOIN projects p ON (p.collectedfrom = s.id) GROUP BY o.id;