Elastic 6.5 sql

elastic 6.5.4
SELECT vehicleid,sum(distance) as distance,sum(duration) as duration where beginTime >= 20181201 and endTime < 20190101 FROM dw_vehicle_mileage3 group by vehicleid order by distance

error:Cannot order by non-grouped column [distance], expected [vehicleid]"}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.