在我的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)