# organizations_simple_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 |  |  |
city | text | 2147483647 | √ |  | null |  |  |
country | text | 2147483647 | √ |  | null |  |  |
status | text | 2147483647 | √ |  | null |  |  |
acronyms | _text | 2147483647 | √ |  | null |  |  |
urls | _text | 2147483647 | √ |  | null |  |  |
n_similar_dups | int8 | 19 | √ |  | null |  |  |
n_suggested_dups | int8 | 19 | √ |  | null |  |  |
n_different_dups | int8 | 19 | √ |  | null |  |  |
candidate_dup | bool | 1 | √ |  | null |  |  |

### View Definition

SELECT org.id, org.name, org.type, org.city, org.country, org.status, array_remove(array_agg(DISTINCT a.acronym), NULL::text) AS acronyms, array_remove(array_agg(DISTINCT u.url), NULL::text) AS urls, count(DISTINCT d1.oa_original_id) FILTER (WHERE (d1.reltype = 'is_similar'::text)) AS n_similar_dups, count(DISTINCT d1.oa_original_id) FILTER (WHERE (d1.reltype = 'suggested'::text)) AS n_suggested_dups, count(DISTINCT d1.oa_original_id) FILTER (WHERE (d1.reltype = 'is_different'::text)) AS n_different_dups, ((org.status = 'raw'::text) AND (NOT ('is_similar'::text = ANY (array_agg(d2.reltype))))) AS candidate_dup FROM ((((organizations org LEFT JOIN acronyms a ON ((org.id = a.id))) LEFT JOIN urls u ON ((org.id = u.id))) LEFT JOIN oa_duplicates d1 ON ((org.id = d1.local_id))) LEFT JOIN oa_duplicates d2 ON ((org.id = d2.oa_original_id))) GROUP BY org.id, org.name, org.type, org.city, org.country, org.status;

### Possibly Referenced Tables/Views

- acronyms
- urls
- organizations
- oa_duplicates