SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem in series order by

    Dear All

    Please help me to resolve this issue

    I am a having a table which is having a coloum containing a series like zc500, zc501, zc502.......zc800, zc801, zc802.......zc8010,zc8011,

    when I am executing the query on this table like

    select Veid from table order by veid

    It is displaying like this zc500,zc501,zc510.....zc800,zc801,zc8010,zc8011,zc8012

    but it should display like this zc801,zc802,...............zc8010,

    please help me to resolve this issue

    Thanks&Regards.
    MD.Samiuddin

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,250
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    ORDER BY CAST(SUBSTRING(veid FROM 3) AS UNSIGNED)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2010
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much.
    Problem is solved, I got the desired result with your solution
    Regards
    Samiuddin


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
  •