I use function group_by in mysql, but in big data 116000 record when I run this sintax there is more than 1 same data. What should I do ??
SELECT fiedl1, field2, field3
FROM table
GROUP BY field2
ORDER BY 'field2' ASC
field1|field2|field3
1 |you |a
2 |you |b
3 |you |c
4 |you |d
5 ...etc
result
field1|field2|field3
1 |you |a
2 |you |b
Best practice is to use group by on all fields, or agregate functions, for example
SELECT fiedl1, field2, field3 FROM table GROUP BY fiedl1, field2, field3 ORDER BY field2 ASC
OR
SELECT sum(fiedl1), field2, avg(field3) FROM table GROUP BY field2 ORDER BY field2 ASC