原SQL语句:
select
id, date, batch, worm_group, hatch_box_number, hatch_end_time, fhhlkfhw_weight
from h
where hatch_end_time is null
and fhhlkfhw_weight is null
and id in (select max(id) from h group by (batch, worm_group, hatch_box_number))
修改:
将group by后面的()去掉
select
id, date, batch, worm_group, hatch_box_number, hatch_end_time, fhhlkfhw_weight
from h
where hatch_end_time is null
and fhhlkfhw_weight is null
and id in (select max(id) from h group by batch, worm_group, hatch_box_number)