From: jkraai Date: March 26 1999 3:24am Subject: Re: Problem with order by List-Archive: http://lists.mysql.com/mysql/1002 Message-Id: <36FAFDD5.E7D8C868@polytopic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit If you're truly looking for the cheapest, try select startdate, enddate, boarding, price, hotelname, hotelresidence, stars, hotelcode, time from table order by price limit 1 But it looks like you want something other than that from your query with the group by clause. --jim Thomas Booms EDV wrote: > > Hello, > > I have a Database with some travels (about 1,500,000 ). > The table looks so: > > organizer text, > startpoint text, > destination text, > startdate date, > enddate date, > hotelcode text, > placingcode text, > boarding text, > price double, > hotelname text, > hotelresidence text, > stars text, > time int, > journeytype text, > persons int > > Now I want to compare all Providers and get the cheapest. > > Here's the query: > > select distinct startdate, enddate, boarding, min(price), hotelname, > hotelresidence, stars, hotelcode, time from table group by startdate, > enddate, hotelname, hotelresidence order by price > > The result is not fully sorted by the price ! > It looks like some groups which are sorted and not the whole list is > sorted. > > Am I wrong with the query or is it a bug in MySQL ? > > Yours Thomas Booms