Additional information about MySQL Group_concat columns that cannot be displayed as empty

Source: Internet
Author: User

Today to do the project encountered a problem, Baidu has not found a long time the problem lies

It's jiangzi, a table.

The associated table

Then I query with the SQL statement

Point.pid,point.pname,group_concat (downsite.pname) dname from Point,downsite where Point.pid=downsite.pid GROUP by Point.pid

It turned out to be

Where is the information of Beijing point???? Finally asked the big God just know, I this SQL statement two table connection way is not, the way to connect outside, because the above kind of connection is within the connection, only two tables match the row to appear in the result set, outside the connection there is no limit.

The last SQL statement is
Select Point.pid,point.pname,group_concat (downsite.pname) dname from point
Left join Downsite on Point.pid=downsite.pid GROUP by Point.pid success

Additional information about MySQL Group_concat columns that cannot be displayed as empty

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.