Mysql-correct MYSQL statement, please be barefoot

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.