SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Hiding from the world
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Starting an order by query in a specific place?

    Hi,
    is it possible to start an ORDER BY query in a certain place. for example if i have ID numbers

    1
    2
    3
    4
    5

    can i ORDER BY id starting at 2 thereby giving me

    2
    3
    4
    5
    1

    or is this impossible ? Thanks
    If i am a product of your imagination you should try harder!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    ORDER BY case when fld > 1 then 9 else 37 end, fld
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Hiding from the world
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool thanks i'll gave that a try.
    If i am a product of your imagination you should try harder!


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
  •