SELECT data1, data16, SUM(dt2), MIN(data5)&&MAX(data5)
FROM records
ORDER BY data6 ASC
GROUP BY data6, data1
Use
SUM()
for adding all the same data in specific column.
And also, use
MIN()
&
MAX()
for determining the minimum and maximum data in a specific column.
ASC
is for ascending order.
Hope this will help you!
Thanks and regards!