reporting ulasan excel

 avatar
teguhikhlas
pgsql
a year ago
921 B
3
Indexable
Never
        select 
        distinct 
        t.id as id_tiket ,
        t.description_user ,
        t.username_user ,
        t.score as rating ,
        s.name as service ,
        ss.name as sub_service ,
        t.feedback_user as ulasan,
        STRING_AGG ( distinct
        a2.username_assignee,','
        order by a2.username_assignee 
        ) username_assignee,
        STRING_AGG ( distinct
        a2.resolution_assignee,','
        order by a2.resolution_assignee 
        ) resolusi
    from tickets t 
    inner join assignments a ON a.ticket_id = t.id 
    inner join task t2 on t2.assignment_id = a.id 
    inner join assignees a2 on a2.task_id = t2.id 
    inner join sub_service ss on ss.id = a.subservice_id 
    inner join services s on s.id = ss.service_id 
    
         
         
         
         
         
        
        
    group by t.id, s.name , ss.name