Supposing I have something like
Name | username |
---|---|
Mike | BestMike99 |
Someone | DaBest |
What query do I need to run in order to SELECT/return a json like
json_agg |
---|
{Mike: BestMike99, Someone: Dabest} |
Supposing I have something like
Name | username |
---|---|
Mike | BestMike99 |
Someone | DaBest |
What query do I need to run in order to SELECT/return a json like
json_agg |
---|
{Mike: BestMike99, Someone: Dabest} |
2
Answers
Having
It would be
Working sample here
You can use
jsonb_object_agg()