ORDER BY length of entry

Discussion in 'Databases' started by projectWORD, Aug 14, 2008.

  1. #1
    Hi,
    How can I order a table so the length of the entry is ordered by. See example, this table:-

    Name ID
    John 1
    Bill 2
    Graham 3
    Bob 4
    Jay 5

    Would give something like

    Name ID
    Bob 4
    Jay 5
    Bill 2
    John 1
    Graham 3



    thanks
     
    projectWORD, Aug 14, 2008 IP
  2. projectWORD

    projectWORD Active Member

    Messages:
    287
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #2
    Hi, I figured it, I used ORDER BY char_length(COLUMN_NAME)
     
    projectWORD, Aug 14, 2008 IP