Prøv denne:
SELECT hotels.hotelID,
hotels.hotelName,
GROUP_CONCAT(operators.opName SEPARATOR ', ') AS opList
FROM hotels
INNER JOIN operators
ON operators.opHotelID = hotels.hotelID
GROUP BY(hotels.hotelID)
Hvis du vil have antallet af operatører, skal du bruge COUNT på operatørens ID sådan:
SELECT hotels.hotelID,
hotels.hotelName,
GROUP_CONCAT(operators.opName SEPARATOR ', ') AS opList,
COUNT(operators.opID) AS nbOperatos
FROM hotels
LEFT JOIN operators
ON operators.opHotelID = hotels.hotelID
GROUP BY(hotels.hotelID)