Search Postgresql Archives

Re: Custom sort

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

 



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', column='three'  ?

Thanks all. I'm not sure it's the best solution but,
here's what I ended up doing

ORDER BY strpos(column_name, 'One,Two,Three')


[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