SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast duff_beer's Avatar
    Join Date
    Jul 2003
    Location
    up in the clouds
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    different algorithm for ORDER BY?

    Is there a way to force the sorting algorithm of an ORDER BY?

    I'm not talking about ASC, DESC.

    I actually get the data ordered almost as I want, but some special characters (÷, Š, ...) are not in the order I need.

    I want those special chars ordered as they were not special chars,
    i.e.:

    abcd
    abco
    abc÷
    abcu

    and not

    abcd
    abco
    abcu
    abc÷

    How can I force the charset I need to comply with during the sorting?

    Thanks

  2. #2
    SitePoint Guru CompiledMonkey's Avatar
    Join Date
    Sep 2002
    Location
    Richmond, VA
    Posts
    975
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know about doing it in SQL, but you could certainly do it in code.

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,016
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #4
    SitePoint Enthusiast duff_beer's Avatar
    Join Date
    Jul 2003
    Location
    up in the clouds
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many many thanks! That was exactly what I was looking for!

    My search on the manual was too specific and didn't get any result, or too vague and received too many, unuseful, links.

    Thanks.

    @CompiledMonkey: of course that was not an option, I needed a fast, one-pass, unbuffered ordering... thanks for the comment, anyway.

  5. #5
    SitePoint Guru CompiledMonkey's Avatar
    Join Date
    Sep 2002
    Location
    Richmond, VA
    Posts
    975
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by duff_beer
    @CompiledMonkey: of course that was not an option, I needed a fast, one-pass, unbuffered ordering... thanks for the comment, anyway.
    Using the proper sorting algorithm could have given you very fast speeds, probably not SQL like, but pretty fast.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •