search

Home  >  Q&A  >  body text

mysql - How to set the group by statement in sequel Pro to default to the first record of the group

select age,money from t1.gz group by age;
发现报错:Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 't1.gz.money' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

PHP中文网PHP中文网2696 days ago1768

reply all(1)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-07-07 10:37:36

    Your current sql_mode does not allow non-aggregated fields to appear in the form of non-aggregated functions. Just change sql_mode, or min(id) takes the first row of records and then connects to the original table to get the results you want

    reply
    0
  • Cancelreply