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. Last value in a Table

Last value in a Table

Scheduled Pinned Locked Moved Database
tutorial
6 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.
  • B Offline
    B Offline
    BINOVAR
    wrote on last edited by
    #1

    how to find the last value in a Table . My table was designed by another person ..it doesnt have any Identity column .. It has only EMPname,Empaddress,EmpContactno. can any one pls tell me how to find the last value in the table Thanks in advance Regards Bino varghese

    A P 2 Replies Last reply
    0
    • B BINOVAR

      how to find the last value in a Table . My table was designed by another person ..it doesnt have any Identity column .. It has only EMPname,Empaddress,EmpContactno. can any one pls tell me how to find the last value in the table Thanks in advance Regards Bino varghese

      A Offline
      A Offline
      Aavesh Agarwal
      wrote on last edited by
      #2

      you mean to say u want a last record of the Table...is that so...

      A 1 Reply Last reply
      0
      • A Aavesh Agarwal

        you mean to say u want a last record of the Table...is that so...

        A Offline
        A Offline
        Aavesh Agarwal
        wrote on last edited by
        #3

        if i m getting you correct so let me tell you there is no such way by which u can get the last row of the tabe u shuld be more specific abut ur query..but there is a way by which u can achieve ur task. select top 1 * from table order by somefield Hope it will work for you. Thanks and regards Aavesh Agaerwal

        1 Reply Last reply
        0
        • B BINOVAR

          how to find the last value in a Table . My table was designed by another person ..it doesnt have any Identity column .. It has only EMPname,Empaddress,EmpContactno. can any one pls tell me how to find the last value in the table Thanks in advance Regards Bino varghese

          P Offline
          P Offline
          Paddy Boyd
          wrote on last edited by
          #4

          Last value by what criteria?

          B 1 Reply Last reply
          0
          • P Paddy Boyd

            Last value by what criteria?

            B Offline
            B Offline
            BINOVAR
            wrote on last edited by
            #5

            hi all Thanks for ur reply.. If I order by I vl not get the last value in the table.. I want the last record in the table .

            P 1 Reply Last reply
            0
            • B BINOVAR

              hi all Thanks for ur reply.. If I order by I vl not get the last value in the table.. I want the last record in the table .

              P Offline
              P Offline
              pmarfleet
              wrote on last edited by
              #6

              One of the fundamental principles of a relational database is that the physical order of rows and columns in the tuples (tables) is not important. http://en.wikipedia.org/wiki/Relational_database[^] If you need to extract data in a particular order, the data itself should provide the means of doing this. For instance, if you had an numeric EmployeeID field which was incremented every time a new employee joined the company then you could find the last value in your table by selecting the row of data with the highest EmployeeID value. You don't have any data items that you can use for this purpose in your table so you can't achieve this.

              Paul Marfleet

              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