Re: Sorting strings numerically

From: Marek Šab (msab..uk.cvut.cz)
Date: Thu Sep 23 2010 - 21:43:19 UTC

  • Next message: Aristedes Maniatis: "Re: Sorting strings numerically"

    Hi Michael,

    sorry, my first post was probably confusing.
    I could do it programmatically but I want to know if it is possible with
    cayenne sorting engine, paraphrased, Can I modify sort order property
    for cayenne somehow, e.g. as MySQL function INET_ATON()?

    Meanwhile I can create a template query:

    SELECT ipAddress FROM Ip4Address ORDER BY
    INET_ATON(Ip4Address.ipAddress) ASC

    Regards,

    -- 
    Marek Šabo
    

    On 09/23/2010 11:17 PM, Michael Gentry wrote: > Hi Marek, are you asking if the database can do it or are you wanting > to do it in your application's memory with (or without) Cayenne? > > mrg > > On Thu, Sep 23, 2010 at 6:35 AM, Marek Šabo <msab..uk.cvut.cz> wrote: > >> Hi, >> >> I would like to know if there is a way to sort string(varchar) columns >> numerically. I know it's bad design but legacy database can't be changed >> atm. I'm talking about IPv4 columns, which we need to sort. ( In new model I >> aim to store them as integers and map extra column in cayenne with mysql >> INET_ATON(), hope it will work.) >> I tried to add "+0" to sort order property, but it failed parsing. >> >> Regards, >> >> -- >> Marek Šabo >> >> >> >> >



    This archive was generated by hypermail 2.0.0 : Thu Sep 23 2010 - 21:43:53 UTC