Nr1 Nr2 Nr3 Nr4 Nr5
158181 1100 6930 48276575 8
158181 1200 6880 48276575 8
158181 1200 6920 48276575 8
SELECT COUNT(*),SUM(Nr3),GROUP_CONCAT(Nr2 ORDER BY Nr2 ASC)
FROM tabelle
GROUP BY Nr1,Nr4,Nr5
Result:
3 20730 1100,1200,1200
Desired Result
2 13810 1100,1200
1 6920 1200
Explanation:
Hello,
As you can see in the example, I want to group with the condition that No.2 cannot be the same.
Thank you
158181 1100 6930 48276575 8
158181 1200 6880 48276575 8
158181 1200 6920 48276575 8
SELECT COUNT(*),SUM(Nr3),GROUP_CONCAT(Nr2 ORDER BY Nr2 ASC)
FROM tabelle
GROUP BY Nr1,Nr4,Nr5
Result:
3 20730 1100,1200,1200
Desired Result
2 13810 1100,1200
1 6920 1200
Explanation:
Hello,
As you can see in the example, I want to group with the condition that No.2 cannot be the same.
Thank you