SELECT
p.price,
h.name AS hotel_name
FROM
prices p
LEFT JOIN hotels h ON p.hotel_id = h.id
WHERE
p.city = 'boedapest'
AND p.hotel_id IS NOT NULL
GROUP BY p.name
ORDER BY p.price ASC
RESULT:
26 Eben Hotel Budapest
27 Veritas
28 Ibis Budapest Heroes Square
29 Hunguest Hotel Griff
30 Hotel Thomas
31 NH Budapest
31 Rubin Wellness and Conference Hotel
32 Benczur Hotel
33 Atlantic
33 Delibab Hotel Budapest
Exactly the same result with the GROUP BY commented out:
24 Gerand Hotel Ventura
25 Hunguest Hotel Platanus
26 Boulevard City Guesthouse
26 Tulip Inn Millennium Budapest
26 Eben Hotel Budapest
27 Veritas
27 Baross
28 Hotel Thomas
28 Hunguest Hotel Griff
28 Ibis Budapest Heroes Square
Basically I would like to GROUP by name, but keep the ORDER BY. Since 24 is less than 26, I kind of expect it to show up earlier than 26. Also keep in mind, I'm displaying only the first 10 results, to keep the post short.
I'm using: SELECT VERSION() -> 5.1.37