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 get a specific row

how to get a specific row

Scheduled Pinned Locked Moved Database
databaseoraclehelptutorial
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.
  • S Offline
    S Offline
    sudharsong
    wrote on last edited by
    #1

    hi, i just want to know is it possible to get a row by its number in SQL like rowid in oracle.if it is there some one please help me. like i want to get the values of 10 th row.

    with regards, susa

    E F M 3 Replies Last reply
    0
    • S sudharsong

      hi, i just want to know is it possible to get a row by its number in SQL like rowid in oracle.if it is there some one please help me. like i want to get the values of 10 th row.

      with regards, susa

      E Offline
      E Offline
      Eric Dahlvang
      wrote on last edited by
      #2

      SELECT TOP 1 * FROM (SELECT TOP 10 * FROM tablex ORDER BY columnx DESC) AS aliasx ORDER BY columnx ASC

      --EricDV Sig--------- Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peters

      1 Reply Last reply
      0
      • S sudharsong

        hi, i just want to know is it possible to get a row by its number in SQL like rowid in oracle.if it is there some one please help me. like i want to get the values of 10 th row.

        with regards, susa

        F Offline
        F Offline
        fs63
        wrote on last edited by
        #3

        Rowid in Oracle doesn't represent the order of a row, is just a unique identifier. In the relational theory (so in ANY database of the world) it doesn't exists the "order of rows in a table", they're data set. Before you jump on the horse of "rowid" or "rownum", read http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:948366252775#1490602760087 and http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/sql_elements6a.htm#19762 If you need some sort of "order", find the right column to apply a "order by", this is the only way to have data sorted out from a database.

        1 Reply Last reply
        0
        • S sudharsong

          hi, i just want to know is it possible to get a row by its number in SQL like rowid in oracle.if it is there some one please help me. like i want to get the values of 10 th row.

          with regards, susa

          M Offline
          M Offline
          Member_3269611
          wrote on last edited by
          #4

          Hi Friend, If U want to get the 10th Row: ------------------------------ SELECT TOP 1 * FROM (SELECT top 10 * FROM TABLENAME ORDER BY NUMERICCOLUM) AS SUBS order by NUMERICCOLUM desc If U want to get the 12th Row: ------------------------------ SELECT TOP 1 * FROM (SELECT top 12 * FROM TABLENAME ORDER BY NUMERICCOLUM) AS SUBS order by NUMERICCOLUM desc With Regards, Pandian S

          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