I’m working on an assignment for class and the question asks to find matches in the same column on the same table. and to list all rows that have this match. Let me just post the question to better explain it:
List the part number, part description, and item class for each pair of parts that are in the same item class. (For example, one such pair would be part AT94 and part FD21, because the item class for both parts is HW.)
I’m not sure which function to use to do this. Does the teacher just want us to group the results by class?
I’m going to give you part of the answer:
You need pairs. So you’ll be essentially GROUPing items HAVING a count of 2.
Good luck!
Addendum:
Remember to use aggregating functions for all items after SELECT that are not in GROUP BY. Depending on the database engine you are using, there are concatenation functions which could be useful.