Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2011
    Posts
    1

    Unanswered: Problem with order by of varchar

    Hi,

    I has a table of names with this data:

    GABRIELA CARVALHO
    GRABIEL ALVES

    When I try:

    select name from table order by name

    Thes system return:

    GABRIELA CARVALHO
    GRABIEL ALVES

    But this is wrong, the correct is:

    GRABIEL ALVES
    GABRIELA CARVALHO

    Because GRABRIEL has less letter than GABRIELA.

    Why this happen and how fix?

    Thanks

  2. #2
    Join Date
    Nov 2006
    Posts
    82
    Of course you are wrong,

    'GABRIELA'<'GRABIEL' because the first word has 'A' on the second position and the second has 'R'. Letter A is much before R.

Posting Permissions

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