Re: [GENERAL] Custom sort

2008-08-15 Thread Artacus
Can you define a custom sort in postgres? For instance in mysql, you could do something like (I forget the exact syntax) ORDER BY FIND_IN_SET(column_name, ('one','two','three')) I don't really know this syntax but isn't it something like : ORDER BY column_name='one', column_name='two', colum

Re: [GENERAL] Custom sort

2008-08-14 Thread Craig Ringer
Artacus wrote: > Can you define a custom sort in postgres? For instance in mysql, you > could do something like (I forget the exact syntax) > > ORDER BY FIND_IN_SET(column_name, ('one','two','three')) The simplest direct mapping would probably be a CASE statement (see the PostgreSQL documentation

Re: [GENERAL] Custom sort

2008-08-14 Thread Jeff Davis
On Thu, 2008-08-14 at 10:22 -0700, Artacus wrote: > Can you define a custom sort in postgres? For instance in mysql, you > could do something like (I forget the exact syntax) > > ORDER BY FIND_IN_SET(column_name, ('one','two','three')) > You can sort by any column, or arbitrary expression or fu

Re: [GENERAL] Custom sort

2008-08-14 Thread Bill Moran
In response to Artacus <[EMAIL PROTECTED]>: > Can you define a custom sort in postgres? For instance in mysql, you > could do something like (I forget the exact syntax) > > ORDER BY FIND_IN_SET(column_name, ('one','two','three')) You could do this by defining an ENUM for the values. ENUMs sort

Re: [GENERAL] Custom sort

2008-08-14 Thread Guillaume Lelarge
Artacus a écrit : > Can you define a custom sort in postgres? For instance in mysql, you > could do something like (I forget the exact syntax) > > ORDER BY FIND_IN_SET(column_name, ('one','two','three')) > I don't really know this syntax but isn't it something like : ORDER BY column_name='one'

[GENERAL] Custom sort

2008-08-14 Thread Artacus
Can you define a custom sort in postgres? For instance in mysql, you could do something like (I forget the exact syntax) ORDER BY FIND_IN_SET(column_name, ('one','two','three')) Art -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http