By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version() |
---|
8.0.30 |
Records: 3 Duplicates: 0 Warnings: 0
comment_id | news_id | comment_names | comment_date | comments |
---|---|---|---|---|
1 | 1 | Comment1 | 2023-01-01 10:00:00 | This is the first comment |
2 | 1 | Comment2 | 2023-01-02 11:00:00 | This is the second comment |
3 | 1 | Comment3 | 2023-01-03 12:00:00 | This is the third comment |
Records: 3 Duplicates: 0 Warnings: 0
reply_id | comment_id | reply_names | reply | reply_date |
---|---|---|---|---|
1 | 1 | ReplyName1 | Reply1 | 2023-01-01 00:00:00 |
2 | 2 | ReplyName2 | Reply2 | 2023-01-02 00:00:00 |
3 | 3 | ReplyName3 | Reply3 | 2023-01-03 00:00:00 |
comment_id | news_id | comment_names | comment_date | comments | cr |
---|---|---|---|---|---|
1 | 1 | Comment1 | 2023-01-01 10:00:00 | This is the first comment | [{"id": 1, "names": "ReplyName1", "reply": "Reply1", "reply_date": "2023-01-01", "reply_time": "00:00:00.000000"}] |
2 | 1 | Comment2 | 2023-01-02 11:00:00 | This is the second comment | [{"id": 2, "names": "ReplyName2", "reply": "Reply2", "reply_date": "2023-01-02", "reply_time": "00:00:00.000000"}] |
3 | 1 | Comment3 | 2023-01-03 12:00:00 | This is the third comment | [{"id": 3, "names": "ReplyName3", "reply": "Reply3", "reply_date": "2023-01-03", "reply_time": "00:00:00.000000"}] |
JSON |
---|
[{"id": 1, "names": "Comment1", "replies": [{"id": 1, "names": "ReplyName1", "reply": "Reply1", "reply_date": "2023-01-01", "reply_time": "00:00:00.000000"}], "comments": "This is the first comment", "comment_date": "2023-01-01", "comment_time": "10:00:00.000000"}, {"id": 2, "names": "Comment2", "replies": [{"id": 2, "names": "ReplyName2", "reply": "Reply2", "reply_date": "2023-01-02", "reply_time": "00:00:00.000000"}], "comments": "This is the second comment", "comment_date": "2023-01-02", "comment_time": "11:00:00.000000"}, {"id": 3, "names": "Comment3", "replies": [{"id": 3, "names": "ReplyName3", "reply": "Reply3", "reply_date": "2023-01-03", "reply_time": "00:00:00.000000"}], "comments": "This is the third comment", "comment_date": "2023-01-03", "comment_time": "12:00:00.000000"}] |