OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: ORDER BY Help

From: Olexandr Melnyk (omelnykgmail.com)
Date: Fri Oct 24 2008 - 07:26:01 CDT


SELECT ProductName FROM Products
 WHERE ProductScore > 100
 ORDER BY CASE WHEN ProductScore = 125
  THEN 0
  ELSE 1
  END, ProductScore

But this query won't use an index, so it would be a good idea to do this in
two queries
2008/10/24 Tompkins Neil <neil.tompkinsgooglemail.com>

> Hi
>
> I've the following basic query like
>
> SELECT ProductName FROM Products
> WHERE ProductScore > 100
> ORDER BY ProductScore
>
> However, how can I order by ProductScore, but ensure the product with ID
> 125
> is at the top ? Is this possible.
>
> Thanks
> Neil
>

--
Sincerely yours,
Olexandr Melnyk
http://omelnyk.net/