View previous topic :: View next topic
|
Author |
Message |
lakshmibala
New User
Joined: 16 Jun 2004 Posts: 47
|
|
|
|
Hi all,
i have a doubet can v retrieve rows frm middle of a table i.e frm 100 to 125 , how is it possible?
Regards
Lakshmi |
|
Back to top |
|
|
ConnoisseuR
New User
Joined: 06 Aug 2004 Posts: 8 Location: india
|
|
|
|
Each row in the TABLE is provided with an unique id i.e. TABLE ID.
you can put a simple select query like this:
SELECT *
FROM TABLE_NAME
WHER TABLE_ID BETWEEN 100 AND 500;
Thanks
santosh |
|
Back to top |
|
|
lakshmibala
New User
Joined: 16 Jun 2004 Posts: 47
|
|
|
|
HI,
u said the range from 100 to 500, but i am asking 100th row from 500th row ok, r u under stand my question,
regrds
Lakshmi |
|
Back to top |
|
|
sandip_datta
Active User
Joined: 02 Dec 2003 Posts: 150 Location: Tokyo, Japan
|
|
|
|
Lakshmi,
I am really confused about the sentence structure of your last post. May be I don't know that much good english. Can you please put some verb in the sentence in proper place and let us know what actually do you want?
Regards,
Sandip. |
|
Back to top |
|
|
anuradha
Active User
Joined: 06 Jan 2004 Posts: 247 Location: Hyderabad
|
|
|
|
Hi Lakshmi,
Quote: |
u said the range from 100 to 500, but i am asking 100th row from 500th row ok, r u under stand my question |
Do u want the rows from 100 to 500 or what?
If Yes then just modify the query given by santosh accordingly.
SELECT *
FROM TABLE_NAME
WHER TABLE_ID BETWEEN 99 AND 501
So,I hope this will fetch the rows from 100 to 500.
Thanks,
Anu |
|
Back to top |
|
|
ConnoisseuR
New User
Joined: 06 Aug 2004 Posts: 8 Location: india
|
|
|
|
hi lakshmi , i got your problem.this can be done by FETCH FIRST N ROWS
QUERY WILL BE LIKE THIS
SELECT *
FROM TABLE_NAME
WHERE TABLE_ID = 500
FETCH FIRST 100 ROWS ONLY
hope this makes it clear now.
santosh |
|
Back to top |
|
|
ConnoisseuR
New User
Joined: 06 Aug 2004 Posts: 8 Location: india
|
|
|
|
hi anuradha,
i would like to correct you that BETWEEN implies including both the boundaries.
so if we write
select *
from table
where field between 100 and 500
this query will process the records including the 100th and 500th.
santosh |
|
Back to top |
|
|
|