select field0002,field0004,field0005,max(field0009) field0009,max(field0010) field0010,max(field0012) field0012 from 表名 group by field0002,field0004,field0005