I have a table with 5 fields. Two of the fields will have duplicate values that match. I think I need to use one or two JOINS to get the data results I want.
Fields: Machine, Message, Date, Severity, ID
The two fields that will have duplicates are Machine and Message.
EXAMPLE DATA:
MACHINE | MESSAGE
--------------------
MACHINE1 | ERROR1
MACHINE2 | ERROR1
MACHINE3 | ERROR1
MACHINE2 | ERROR2
MACHINE2 | ERROR2
MACHINE3 | ERROR3
MACHINE1 | ERROR3
MACHINE1 | ERROR1
I need the results to be like this:
MACHINE1, 2 - ERROR1, 1 - ERROR3
MACHINE2, 1 - ERROR1, 2 - ERROR2
MACHINE3, 1 - ERROR1, 1 - ERROR3
I've been trying to search for the answer to this but haven't found the answer. I believe I will need JOIN or two with a possible GROUP BY
.