MySQL GROUP BY behavior

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

Given the following table \'foo\'

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


        
6条回答
  •  旧时难觅i
    2020-11-29 07:29

    In standard SQL, This SQL should fail, with a server processor error something like

    "firstname, and lastname cannot be included in the select clause unless they are also in the group By, or are part of an aggregate function."

    Does MySql actually return data for this ?

提交回复
热议问题