I have data in oracle as below
And I want to return nested json like this
Currently I have to create another table for machine code to use fore