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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. last ten records

last ten records

Scheduled Pinned Locked Moved ASP.NET
databasequestion
4 Posts 4 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.
  • P Offline
    P Offline
    Pankaj Garg
    wrote on last edited by
    #1

    Like , i can select top 10 records , how can i select last 10 records . I used the following query , but did not work. select top 10 columnname from tablename order by columnname desc

    If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

    M C G 3 Replies Last reply
    0
    • P Pankaj Garg

      Like , i can select top 10 records , how can i select last 10 records . I used the following query , but did not work. select top 10 columnname from tablename order by columnname desc

      If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

      M Offline
      M Offline
      MHASSANF
      wrote on last edited by
      #2

      i think this is because of your "order"

      1 Reply Last reply
      0
      • P Pankaj Garg

        Like , i can select top 10 records , how can i select last 10 records . I used the following query , but did not work. select top 10 columnname from tablename order by columnname desc

        If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        This is a SQL question, try the SQL forum. But, changing from ASC to DESC, will work.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        1 Reply Last reply
        0
        • P Pankaj Garg

          Like , i can select top 10 records , how can i select last 10 records . I used the following query , but did not work. select top 10 columnname from tablename order by columnname desc

          If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Pankaj Garg wrote:

          but did not work

          You have to be a lot more specific. That something "did not work" is not a useful description. What happened? What did you expect it to do, and how did what it do differ from what you expected? Did you get any error message?

          Pankaj Garg wrote:

          select top 10 columnname from tablename order by columnname desc

          You have to be a lot more specific. That is exactly the example that you would get as answer to your question. What does the actual code that you used look like?

          Despite everything, the person most likely to be fooling you next is yourself.

          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