Last active
December 19, 2018 18:48
-
-
Save RyotaBannai/b0f43acb30db58d2b9ed152c61f26362 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db=# \t //1st command | |
db=# \a //2nd command | |
db=# \o file.json //3rd command | |
db=# SELECT json_agg(json_build_object( //4thcommand | |
'pk', t.id,'model','meryota.question', 'fields', | |
json_build_object('question_text',t.question_text, | |
'pub_date',t.pub_date))) from meryota_question as t; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment