I'm trying to create an SQL query that will combine rows where a row sharing an ID is found, but print normally if now. I have a Computer and Harddisk database. The Computer DB has a Id and the Harddisk DB har a Id and a ComputerId for the associated computer. Some computers have more harddisks so I'd like to combine these into the same column.
I've attached a image below explaining the two tables and the desired output: 1
My current query reads: $queryHDDS = "SELECT *,CONCAT(ComputerId) FROM HardDisk GROUP BY Id";
Trouble is it is no combining two harddisks that are associated by a shared ComputerId
Hope someone is able to help me out with this!