MySQL GROUP BY behavior

后端 未结 6 585
春和景丽
春和景丽 2020-11-29 06:53

Given the following table \'foo\'

ID | First Name | Last Name
----------------------------
67   John        Smith
----------------------------
6         


        
6条回答
  •  暖寄归人
    2020-11-29 07:22

    It's very likely that the second (last) row's first name and last name will be picked.

    You can add an ORDER BY clause to give hints on how you'd like the grouped rows to be sorted.

提交回复
热议问题