1. question: I have never understood how to write an SQL statement to calculate a specific result. code: SELECTtb. *, tbc. 'comment' fromblog _ tinyblogAStb. the SQL statement I wrote is as follows! [Image description] (img. ask. csdn. netupload... mysqlsql
1. Question: I have never understood how to write an SQL statement to calculate a specific result.
2. Code:
SELECT tb. *, tbc.Comment
From blog_tinyblog AS tb, blog_tbcomment AS tbc
Where tb. user_id = tbc. user_id AND
Tb. num = tbc. now_num
Group by tbc. num_tiny_blog
The SQL statement I wrote is as follows:
But this is not the result I want. I want to remove duplicates and store comment as an array, so that there is only one result. please be barefoot. Distinct may be used, but not
This is the case now, but I have sent more than 3 Weibo posts and more than 10 Weibo posts. other posts are not displayed because they are not commented. I don't know how to write them, I want to display all Weibo posts and comments