Why does the order change after mysql uses group_concat?
天蓬老师
天蓬老师 2017-05-18 10:49:30
0
1
669

Since the fields in the two tables contain a one-to-many relationship, the group_concat function was used to splice multiple pieces of data when constructing the view to reduce the amount of data. However, after splicing, it was found that the original order had changed.
For example :
raw data:

    a                  1
    a                  2
    a                  3

Expected results:

    a                  1,2,3

actual results:

    a                  2,1,3 (或者其他 总之顺序改变了)
    

what happened?

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!