I have a table – NS_Data
ns | tid | res | nid |
---|---|---|---|
BLA88-F-20-30 | ITKT20254 | not include | G0ESM791 |
BLA88-F-20-30 | ITKT20223 | not include | G0ESM791 |
BLA88-F-20-30 | ABCD23456 | not include | G0PNH123 |
BLA88-F-20-30 | ABCD54321 | not include | G0PNH123 |
BLA88-F-20-30 | ITKT21111 | include | G0ESM791 |
I want the output in following format
ns | nid | finalMap |
---|---|---|
BLA88-F-20-30 | G0ESM791 | [{tid=[ITKT20254, ITKT20223],res=not include}, {tid=[ITKT21111],res=include}] |
BLA88-F-20-30 | G0PNH123 | [{tid=[ABCD23456, ABCD54321], res=not include}] |
I want the type of finalMap
array(row(tid array(varchar), res varchar)). I got the result with json but is is not compatible with the expected array(row(tid array(varchar), res varchar)) format.