Maybe the title was not the best I could use to discribe the issue an example of the table structure I am dealing with is in the image below. I need to write a query to pull all records for "Manufactures" that have more than one record. So the end result I would have LINUX UBUNTU 5.6 and LINUX REDHAT 7.8
Just returning the duplicated MANUFACTURE is easy and I can do that with using grouping having count(*) > 1 but when it comes to returning the duplicated manufacture and the corresponding columns with it is the issue I am coming up with.

returning the duplicated MANUFACTURE is easy and I can do that with using grouping
having count(*) > 1
That's a good start. Now use that list of manufactures to select the rest of the data:
SELECT *
FROM software
WHERE manufacture IN (
-- This is your "HAVING COUNT(*) > 1" query inside.
-- It drives the selection of rows in the outer query.
SELECT manufacture
FROM software
GROUP BY manufacture
HAVING COUNT(*) > 1
)
try this:
Select * from myTable
Where Manufacture In
(Select Manufacture
from myTable
Group By Manufacture
Having count(*) > 1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With