select dup."uuid" as primary_key,
dup.device_uuid,
product.name, 
pt.type,
dup.user_uuid as authorized_user_id,
dup.created_at::date as permission_creation_date,
dup.updated_at::date as permission_update_date
from "device-user-permission" dup
left join "permission-type" pt 
	on dup.permission_type_uuid =pt."uuid" 
left join device
	on device."uuid" =dup.device_uuid 
LEFT JOIN product
        ON product.uuid = device.product_device_uuid