Search Postgresql Archives

Re: sort character data in arbitrary order?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jan 14, 2006 at 01:38:52PM -0600, Robert Paulsen wrote:
> 
> 	SELECT foo, bar, baz, FROM my_table WHERE state ~ '[abc]'
> 	ORDER BY state ASC LIMIT 1.
> 
> This works as expected. My problem is that I am relying on the collating 
> sequence of the letters a-z and the desirability of states may not always be 
> in this order.

How do you determine desirability?  You could order by an expression
that evaluates to a state's desirability.

-- 
Michael Fuhr


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux