-1
Good afternoon to all,
I have a table called 'ms_msg_log'. In this table, I have the columns 'id_error' and 'data_alt'. I need the data displayed as follows:
id_error = the normal value of the field,
id_error counting but summing only when they are equal,
data_alt
How the data is in the Table
Ex:
id_erro data_alt
2 11-07-21
5 11-07-21
5 11-07-21
3 12-07-21
3 12-07-21
5 12-07-21
5 12-07-21
5 12-07-21
5 12-07-21
5 12-07-21
5 12-07-21
5 12-07-21
Expected outcome of the consultation:
Ex:
id_erro count data_alt
2 1 11-07-21
5 2 11-07-21
3 2 12-07-21
5 7 12-07-21
In case you couldn’t explain it properly, I can try to convey the idea more clearly. I thank you all for your attention,
William
https://www.w3resource.com/mysql/aggregate-functions-and-grouping/aggregate-functions-and-grouping-count-with-group-by.php
– Motta