Oracle SQL - Select only few elements from group -
i have following table representing tasks in processes: task_id | process_id | task_type_id ========+============+============= 1000 | 1 | 1001 | 1 | b 1002 | 1 | c 1003 | 1 | d 1004 | 2 | 1005 | 2 | c 1006 | 2 | d 1007 | 3 | 1008 | 3 | c 1009 | 3 | d i want isolate different process types. process type defined unique sequence of tasks. the following query select process_id, count(*) tasks_no, listagg(task_type_id,'>') within group (order task_id) task_sequence mytable group process_id can isolate task sequences: process_id | tasks_no | task_sequence ===========+==========+============== 1 | 4 | a>b>c>d 2 | 3 | a>c>d 3 | 3 | a>c>d now want aggregate result: task_sequence | tasks_no | process_no | proc_rep_ids ==============+==========+============+========...