小编Wil*_*alk的帖子

SQL数组agg和联接

在我的Postgres数据库中,我有3个表。一个用于users一个用于comments和一个映射两种user_comment_map。表格的外观如下:

users
| id | name | age |
|----|------|-----|
| 1  | user | 20  |


comments
| id | mood  | subject | content         | created_at               |
|----|-------|---------|-----------------|--------------------------|
| 1  | happy | funny   | here is content | Tue Sep 27 2016 13:44:19 |
| 2  | silly | cool    | more content    | Tue Sep 27 2016 14:44:19 |

user_comment_map
| id | user_id | comment_id |
|----|---------|------------|
| 1 …
Run Code Online (Sandbox Code Playgroud)

sql postgresql join knex.js array-agg

5
推荐指数
1
解决办法
2379
查看次数

标签 统计

array-agg ×1

join ×1

knex.js ×1

postgresql ×1

sql ×1