怪我咯2017-04-17 13:46:49
Will the field hk.backMoney display the data corresponding to the largest hk.backTime?
Because you used Group By, the largest hk.backTime under the same userInfoId is displayed
After using aggregate functions on multiple fields, if the other fields are not grouped, there will only be one. How are the other fields obtained?
The method of selecting other fields is related to the specific implementation of the database you use. It may be sorted by default or returned randomly, so generally speaking, Select non-aggregated fields are meaningless in aggregate queries. If you want to achieve something like retrieving a user's most recent operation record, you need to wrap another layer of query statements outside.