Skip to content

Instantly share code, notes, and snippets.

@cristianodabc
Last active June 6, 2022 11:58
Show Gist options
  • Select an option

  • Save cristianodabc/20fd4af294a15b05704f81ceb28abc4b to your computer and use it in GitHub Desktop.

Select an option

Save cristianodabc/20fd4af294a15b05704f81ceb28abc4b to your computer and use it in GitHub Desktop.
```sql
SELECT
json_agg(
json_build_object(
'first_name', u.first_name,
'last_name', u.last_name,
'email', u.email
)
) FROM users AS u
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment