# organizations_view

0 rows

### Columns

Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments
--- | --- | --- | --- | --- | --- | --- | --- | ---
id | text | 2147483647 | √ |  | null |  |  |
name | text | 2147483647 | √ |  | null |  |  |
type | text | 2147483647 | √ |  | null |  |  |
lat | float8 | 17,17 | √ |  | null |  |  |
lng | float8 | 17,17 | √ |  | null |  |  |
city | text | 2147483647 | √ |  | null |  |  |
country | text | 2147483647 | √ |  | null |  |  |
status | text | 2147483647 | √ |  | null |  |  |
ec_legalbody | bool | 1 | √ |  | null |  |  |
ec_legalperson | bool | 1 | √ |  | null |  |  |
ec_nonprofit | bool | 1 | √ |  | null |  |  |
ec_researchorganization | bool | 1 | √ |  | null |  |  |
ec_highereducation | bool | 1 | √ |  | null |  |  |
ec_internationalorganizationeurinterests | bool | 1 | √ |  | null |  |  |
ec_internationalorganization | bool | 1 | √ |  | null |  |  |
ec_enterprise | bool | 1 | √ |  | null |  |  |
ec_smevalidated | bool | 1 | √ |  | null |  |  |
ec_nutscode | bool | 1 | √ |  | null |  |  |
other_ids | jsonb | 2147483647 | √ |  | null |  |  |
other_names | jsonb | 2147483647 | √ |  | null |  |  |
acronyms | jsonb | 2147483647 | √ |  | null |  |  |
urls | jsonb | 2147483647 | √ |  | null |  |  |
relations | jsonb | 2147483647 | √ |  | null |  |  |

### View Definition

SELECT org.id, org.name, org.type, org.lat, org.lng, org.city, org.country, org.status, org.ec_legalbody, org.ec_legalperson, org.ec_nonprofit, org.ec_researchorganization, org.ec_highereducation, org.ec_internationalorganizationeurinterests, org.ec_internationalorganization, org.ec_enterprise, org.ec_smevalidated, org.ec_nutscode, COALESCE(jsonb_agg(DISTINCT jsonb_build_object('id', oid.otherid, 'type', oid.type)) FILTER (WHERE (oid.otherid IS NOT NULL)), '[]'::jsonb) AS other_ids, COALESCE(jsonb_agg(DISTINCT jsonb_build_object('name', n.name, 'lang', n.lang)) FILTER (WHERE (n.name IS NOT NULL)), '[]'::jsonb) AS other_names, COALESCE(jsonb_agg(DISTINCT a.acronym) FILTER (WHERE (a.acronym IS NOT NULL)), '[]'::jsonb) AS acronyms, COALESCE(jsonb_agg(DISTINCT u.url) FILTER (WHERE (u.url IS NOT NULL)), '[]'::jsonb) AS urls, COALESCE(jsonb_agg(DISTINCT jsonb_build_object('relatedOrgId', relorg.id, 'relatedOrgName', relorg.name, 'type', r.reltype)) FILTER (WHERE (relorg.id IS NOT NULL)), '[]'::jsonb) AS relations FROM ((((((organizations org LEFT JOIN other_ids oid ON ((org.id = oid.id))) LEFT JOIN other_names n ON ((org.id = n.id))) LEFT JOIN acronyms a ON ((org.id = a.id))) LEFT JOIN urls u ON ((org.id = u.id))) LEFT JOIN relationships r ON ((org.id = r.id1))) LEFT JOIN organizations relorg ON ((relorg.id = r.id2))) GROUP BY org.id, org.name, org.type, org.lat, org.lng, org.city, org.country, org.status, org.ec_legalbody, org.ec_legalperson, org.ec_nonprofit, org.ec_researchorganization, org.ec_highereducation, org.ec_internationalorganizationeurinterests, org.ec_internationalorganization, org.ec_enterprise, org.ec_smevalidated, org.ec_nutscode;

### Possibly Referenced Tables/Views

- other_ids
- other_names
- acronyms
- urls
- organizations
- relationships