MySQL Forums
Forum List  »  Newbie

Re: ORDER BY question
Posted by: Guelphdad Lake
Date: February 05, 2009 07:42PM

I should either test stuff or tell people it is untested.

SELECT make AS TNPC
FROM 
  used_vehicle 
GROUP BY 
  make 
ORDER BY FIELD(make, 'Dodge','Toyota','Honda',make)

make has to be at the beginning because it tells what field you are ordering, it also needs to be inside at the end so that all other makes will appear after the three you are ordering.

as you say without that it slots the three makes at the bottom of the rest.

sorry for the confusion.

personally I stick to the standard sql syntax myself.

Options: ReplyQuote


Subject
Written By
Posted
j t
February 04, 2009 06:06PM
February 04, 2009 10:04PM
j t
February 05, 2009 11:50AM
j t
February 05, 2009 11:54AM
February 05, 2009 12:42PM
j t
February 05, 2009 02:53PM
Re: ORDER BY question
February 05, 2009 07:42PM
j t
February 12, 2009 05:09PM
February 12, 2009 05:19PM
j t
February 12, 2009 06:55PM
j t
February 12, 2009 08:53PM
February 12, 2009 09:13PM
j t
February 12, 2009 10:14PM
February 13, 2009 09:31AM
j t
February 13, 2009 12:42PM
February 13, 2009 02:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.