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