Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. how to sort on text data type column ?

how to sort on text data type column ?

Scheduled Pinned Locked Moved Database
databasesql-serversysadmintutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    King Shez
    wrote on last edited by
    #1

    HI Can any one let me know, how to sort on cloumn with text data type in SQL Server 2005, thanks in advance, kindly Reply ASAP.

    B W 2 Replies Last reply
    0
    • K King Shez

      HI Can any one let me know, how to sort on cloumn with text data type in SQL Server 2005, thanks in advance, kindly Reply ASAP.

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      select * from table order by columnname asc or select * from table order by columnname desc


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

      K 1 Reply Last reply
      0
      • B Blue_Boy

        select * from table order by columnname asc or select * from table order by columnname desc


        I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

        K Offline
        K Offline
        King Shez
        wrote on last edited by
        #3

        you can not sort column with data type text with order by ASC or DESC, Even group by cann't be use, is there any other wat i can sort the column with the data type text. thankx for ur reply.

        1 Reply Last reply
        0
        • K King Shez

          HI Can any one let me know, how to sort on cloumn with text data type in SQL Server 2005, thanks in advance, kindly Reply ASAP.

          W Offline
          W Offline
          Wendelius
          wrote on last edited by
          #4

          Have a look at SUBSTRING. I believe that you would have gotten far more answers if you wouldn't have requested to reply ASAP. That's considered rude.

          The need to optimize rises from a bad design

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups