p.uuid as uuid, p.kee as kee, p.name as name, p.private as isPrivate, p.description as description, p.qualifier as qualifier, null as authUuid p.uuid as uuid, p.kee as kee, p.name as name, p.private as isPrivate, p.description as description, case when p.parent_uuid is null then 'VW' else 'SVW' end as qualifier, case when p.root_uuid != p.uuid then p.root_uuid else null end as authUuid (select from projects p) UNION (select from portfolios p where p.parent_uuid is null)