Created
May 21, 2019 02:05
-
-
Save rcmoret/1d6e57abbdf945952871778676b0d129 to your computer and use it in GitHub Desktop.
This file contains 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
select t.*, (select json_group_array(json_object('id', s.id, 'amount', s.amount))) from transactions t join transactions s on s.primary_transaction_id = t.id where t.id = 2; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment