I am using postgresql for my webapplication. I am new to this PostgreSQL-json. I Just want to get the select query result in the form of json structure.
Here are my details:

Code:
    Create table
    ============
    - create table sample(id serial, info jsonb);
    Insert query
    ============
    - insert into sample("info") values('{"person": {"phone": 9804484234,"name":{"firstname":"Alice", "lastname":"bob"}, "empId": "E067", "age":25}');
    
    select query:
    =============
    select "info"->'person'->>'lastname' from sample;
    
    result: bob
    
    but I want to get the above result along with the json nodes like below:
    
    result: {"person":
              {"name":
                {"lastname":"bob"}
              }
            }
could any body tell me how to get my expected result structure from database.